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

Function TSContScheduleEveryOnPool

src/api/InkAPI.cc:3494–3535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3492}
3493
3494TSAction
3495TSContScheduleEveryOnPool(TSCont contp, TSHRTime every, TSThreadPool tp)
3496{
3497 sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
3498
3499 /* ensure we are on a EThread */
3500 sdk_assert(sdk_sanity_check_null_ptr((void *)this_ethread()) == TS_SUCCESS);
3501
3502 FORCE_PLUGIN_SCOPED_MUTEX(contp);
3503
3504 INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
3505
3506 if (ink_atomic_increment(static_cast<int *>(&i->m_event_count), 1) < 0) {
3507 ink_assert(!"not reached");
3508 }
3509
3510 EventType etype;
3511
3512 switch (tp) {
3513 case TS_THREAD_POOL_NET:
3514 etype = ET_NET;
3515 break;
3516 case TS_THREAD_POOL_TASK:
3517 etype = ET_TASK;
3518 break;
3519 case TS_THREAD_POOL_DNS:
3520 etype = ET_DNS;
3521 break;
3522 case TS_THREAD_POOL_UDP:
3523 etype = ET_UDP;
3524 break;
3525 default:
3526 etype = ET_TASK;
3527 break;
3528 }
3529
3530 TSAction action = reinterpret_cast<TSAction>(eventProcessor.schedule_every(i, HRTIME_MSECONDS(every), etype));
3531
3532 /* This is a hack. Should be handled in ink_types */
3533 action = reinterpret_cast<TSAction>(reinterpret_cast<uintptr_t>(action) | 0x1);
3534 return action;
3535}
3536
3537TSAction
3538TSContScheduleEveryOnThread(TSCont contp, TSHRTime every, TSEventThread ethread)

Callers 8

handleTimerEventFunction · 0.85
runMethod · 0.85
TSPluginInitFunction · 0.85
PerformAsTaskEveryFunction · 0.85
initializeMethod · 0.85
setupQueueContMethod · 0.85
scheduleEveryMethod · 0.85

Calls 5

this_ethreadFunction · 0.85
ink_atomic_incrementFunction · 0.85
schedule_everyMethod · 0.45

Tested by

no test coverage detected