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

Method setTimerPeriod

plugins/experimental/wasm/ats_context.cc:488–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488WasmResult
489Context::setTimerPeriod(std::chrono::milliseconds period, uint32_t *timer_token_ptr)
490{
491 Wasm *wasm = this->wasm();
492 Context *root_context = this->root_context();
493 TSMutexLock(wasm->mutex());
494 if (!wasm->existsTimerPeriod(root_context->id())) {
495 Dbg(dbg_ctl, "[%s] no previous timer period set", __FUNCTION__);
496 TSCont contp = root_context->scheduler_cont();
497 if (contp != nullptr) {
498 Dbg(dbg_ctl, "[%s] scheduling continuation for timer", __FUNCTION__);
499 TSContDataSet(contp, root_context);
500 TSContScheduleOnPool(contp, static_cast<TSHRTime>(period.count()), TS_THREAD_POOL_NET);
501 }
502 }
503
504 wasm->setTimerPeriod(root_context->id(), period);
505 *timer_token_ptr = 0;
506 TSMutexUnlock(wasm->mutex());
507 return WasmResult::Ok;
508}
509
510BufferInterface *
511Context::getBuffer(WasmBufferType type)

Callers

nothing calls this directly

Calls 11

wasmMethod · 0.95
root_contextMethod · 0.95
TSMutexLockFunction · 0.85
TSContDataSetFunction · 0.85
TSContScheduleOnPoolFunction · 0.85
TSMutexUnlockFunction · 0.85
existsTimerPeriodMethod · 0.80
scheduler_contMethod · 0.80
mutexMethod · 0.45
idMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected