MCPcopy Create free account
hub / github.com/apache/trafficserver / TSContScheduleOnPool_handler_2

Function TSContScheduleOnPool_handler_2

tests/tools/plugins/cont_schedule.cc:121–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static int
122TSContScheduleOnPool_handler_2(TSCont /* contp ATS_UNUSED */, TSEvent /* event ATS_UNUSED */, void * /* edata ATS_UNUSED */)
123{
124 // This runs on ET_TASK threads.
125 Dbg(dbg_ctl_hdl, "TSContScheduleOnPool handler 2 thread [%p]", TSThreadSelf());
126 if (thread_2 == nullptr) {
127 // First time here, record thread id.
128 thread_2 = TSEventThreadSelf();
129 } else {
130 if (thread_2 == TSEventThreadSelf()) {
131 // Second time there, we should be on the same thread even though affinity was cleared,
132 // reason being plugin is running on ET_TASK threads, and we were scheduled on ET_TASK
133 // threads as well, so the thread the plugin is on is used and set to affinity.
134 Dbg(dbg_ctl_chk, "pass [should be the same thread]");
135 } else {
136 Dbg(dbg_ctl_chk, "fail [not the same thread]");
137 }
138 }
139 return 0;
140}
141
142void
143TSContScheduleOnPool_test()

Callers

nothing calls this directly

Calls 2

TSThreadSelfFunction · 0.85
TSEventThreadSelfFunction · 0.85

Tested by

no test coverage detected