This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 5191f06 When using TSContSchedule() and TSContScheduleAPI() set the
calling thread as the thread affinity when not already set
5191f06 is described below
commit 5191f06fcfda196788b0806840e7bc371c6951c0
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
(cherry picked from commit 318728c62ea6dd766e7cd189753db2ca1508bbeb)
---
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 1e07a79..e9a754a 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -4526,7 +4526,8 @@ TSContSchedule(TSCont contp, TSHRTime timeout)
EThread *eth = i->getThreadAffinity();
if (eth == nullptr) {
- return nullptr;
+ eth = this_ethread();
+ i->setThreadAffinity(eth);
}
TSAction action;
@@ -4633,7 +4634,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)));