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

Function TSContScheduleOnPool

src/api/InkAPI.cc:3374–3420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3372}
3373
3374TSAction
3375TSContScheduleOnPool(TSCont contp, TSHRTime timeout, TSThreadPool tp)
3376{
3377 sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
3378
3379 /* ensure we are on a EThread */
3380 sdk_assert(sdk_sanity_check_null_ptr((void *)this_ethread()) == TS_SUCCESS);
3381
3382 FORCE_PLUGIN_SCOPED_MUTEX(contp);
3383
3384 INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
3385
3386 if (ink_atomic_increment(static_cast<int *>(&i->m_event_count), 1) < 0) {
3387 ink_assert(!"not reached");
3388 }
3389
3390 EventType etype;
3391
3392 switch (tp) {
3393 case TS_THREAD_POOL_NET:
3394 etype = ET_NET;
3395 break;
3396 case TS_THREAD_POOL_TASK:
3397 etype = ET_TASK;
3398 break;
3399 case TS_THREAD_POOL_DNS:
3400 etype = ET_DNS;
3401 break;
3402 case TS_THREAD_POOL_UDP:
3403 etype = ET_UDP;
3404 break;
3405 default:
3406 etype = ET_TASK;
3407 break;
3408 }
3409
3410 TSAction action;
3411 if (timeout == 0) {
3412 action = reinterpret_cast<TSAction>(eventProcessor.schedule_imm(i, etype));
3413 } else {
3414 action = reinterpret_cast<TSAction>(eventProcessor.schedule_in(i, HRTIME_MSECONDS(timeout), etype));
3415 }
3416
3417 /* This is a hack. Should be handled in ink_types */
3418 action = reinterpret_cast<TSAction>(reinterpret_cast<uintptr_t>(action) | 0x1);
3419 return action;
3420}
3421
3422TSAction
3423TSContScheduleOnThread(TSCont contp, TSHRTime timeout, TSEventThread ethread)

Callers 15

accept_handlerFunction · 0.85
psi_includeFunction · 0.85
transform_handlerFunction · 0.85
handle_dnsFunction · 0.85
read_denylistFunction · 0.85
cache_handlerFunction · 0.85
mytest_handlerFunction · 0.85

Calls 6

this_ethreadFunction · 0.85
ink_atomic_incrementFunction · 0.85
schedule_immMethod · 0.45
schedule_inMethod · 0.45