MCPcopy Create free account
hub / github.com/apache/brpc / bthread_timer_del

Function bthread_timer_del

src/bthread/bthread.cpp:543–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543int bthread_timer_del(bthread_timer_t id) {
544 bthread::TaskControl* c = bthread::get_task_control();
545 if (c != NULL) {
546 bthread::TimerThread* tt = bthread::get_global_timer_thread();
547 if (tt == NULL) {
548 return EINVAL;
549 }
550 const int state = tt->unschedule(id);
551 if (state >= 0) {
552 return state;
553 }
554 }
555 return EINVAL;
556}
557
558int bthread_usleep(uint64_t microseconds) {
559 bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group);

Callers 5

TriggerOnWritableMethod · 0.85
StopIdleTimerMethod · 0.85
EndRPCMethod · 0.85
DestroyMethod · 0.85
~EpollOutRequestMethod · 0.85

Calls 3

get_global_timer_threadFunction · 0.85
unscheduleMethod · 0.80
get_task_controlFunction · 0.70

Tested by

no test coverage detected