This is an automated email from the ASF dual-hosted git repository.
sudheerv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 318728c When using TSContSchedule() and TSContScheduleAPI() set the
calling thread as the thread affinity when not already set
318728c is described below
commit 318728c62ea6dd766e7cd189753db2ca1508bbeb
Author: Sudheer Vinukonda <[email protected]>
AuthorDate: Thu Mar 26 13:03:47 2020 -0700
When using TSContSchedule() and TSContScheduleAPI() set the calling thread
as the thread affinity when not already set
---
src/traffic_server/InkAPI.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index f21c855..0824666 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -4530,7 +4530,8 @@ TSContSchedule(TSCont contp, TSHRTime timeout)
EThread *eth = i->getThreadAffinity();
if (eth == nullptr) {
- return nullptr;
+ eth = this_ethread();
+ i->setThreadAffinity(eth);
}
TSAction action;
@@ -4643,7 +4644,8 @@ TSContScheduleEvery(TSCont contp, TSHRTime every /*
millisecs */)
EThread *eth = i->getThreadAffinity();
if (eth == nullptr) {
- return nullptr;
+ eth = this_ethread();
+ i->setThreadAffinity(eth);
}
TSAction action = reinterpret_cast<TSAction>(eth->schedule_every(i,
HRTIME_MSECONDS(every)));