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

Function waiter

test/bthread_cond_unittest.cpp:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void* waiter(void* void_arg) {
53 Arg* a = (Arg*)void_arg;
54 bthread_mutex_lock(&a->m);
55 while (!stop) {
56 bthread_cond_wait(&a->c, &a->m);
57
58 BAIDU_SCOPED_LOCK(wake_mutex);
59 wake_tid.push_back(bthread_self());
60 wake_time.push_back(butil::gettimeofday_us());
61 }
62 bthread_mutex_unlock(&a->m);
63 return NULL;
64}
65
66TEST(CondTest, sanity) {
67 Arg a;

Callers

nothing calls this directly

Calls 6

bthread_mutex_lockFunction · 0.85
bthread_cond_waitFunction · 0.85
bthread_selfFunction · 0.85
bthread_mutex_unlockFunction · 0.85
gettimeofday_usFunction · 0.70
push_backMethod · 0.45

Tested by

no test coverage detected