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

Function TSContScheduleOnEntirePool

src/api/InkAPI.cc:3454–3492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3452}
3453
3454std::vector<TSAction>
3455TSContScheduleOnEntirePool(TSCont contp, TSHRTime timeout, TSThreadPool tp)
3456{
3457 sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
3458
3459 /* ensure we are on a EThread */
3460 sdk_assert(sdk_sanity_check_null_ptr((void *)this_ethread()) == TS_SUCCESS);
3461
3462 INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
3463
3464 // This is to allow the continuation to be scheduled on multiple threads
3465 sdk_assert(i->mutex == nullptr);
3466
3467 EventType etype;
3468
3469 switch (tp) {
3470 case TS_THREAD_POOL_NET:
3471 etype = ET_NET;
3472 break;
3473 case TS_THREAD_POOL_TASK:
3474 etype = ET_TASK;
3475 break;
3476 case TS_THREAD_POOL_DNS:
3477 etype = ET_DNS;
3478 break;
3479 case TS_THREAD_POOL_UDP:
3480 etype = ET_UDP;
3481 break;
3482 default:
3483 etype = ET_TASK;
3484 break;
3485 }
3486
3487 if (ink_atomic_increment(static_cast<int *>(&i->m_event_count), eventProcessor.thread_group[etype]._count) < 0) {
3488 ink_assert(!"not reached");
3489 }
3490
3491 return eventProcessor.schedule_entire(i, HRTIME_MSECONDS(timeout), 0, etype, timeout == 0 ? EVENT_IMMEDIATE : EVENT_INTERVAL);
3492}
3493
3494TSAction
3495TSContScheduleEveryOnPool(TSCont contp, TSHRTime every, TSThreadPool tp)

Callers 1

Calls 5

this_ethreadFunction · 0.85
ink_atomic_incrementFunction · 0.85
schedule_entireMethod · 0.80

Tested by

no test coverage detected