| 119 | } |
| 120 | |
| 121 | static int |
| 122 | TSContScheduleOnPool_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 | |
| 142 | void |
| 143 | TSContScheduleOnPool_test() |
nothing calls this directly
no test coverage detected