| 3492 | } |
| 3493 | |
| 3494 | TSAction |
| 3495 | TSContScheduleEveryOnPool(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 | |
| 3537 | TSAction |
| 3538 | TSContScheduleEveryOnThread(TSCont contp, TSHRTime every, TSEventThread ethread) |
no test coverage detected