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

Function even_thread

test/bthread_setconcurrency_unittest.cpp:80–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void *even_thread(void *) {
81 nbthreads.fetch_add(1);
82 while (!stop) {
83 if (!counted) {
84 counted = true;
85 npthreads.fetch_add(1);
86 }
87 bthread::butex_wake_all(odd);
88 bthread::butex_wait(even, 0, NULL);
89 }
90 return NULL;
91}
92
93TEST(BthreadTest, setconcurrency_with_running_bthread) {
94 odd = bthread::butex_create_checked<butil::atomic<int> >();

Callers

nothing calls this directly

Calls 3

butex_wake_allFunction · 0.85
butex_waitFunction · 0.85
fetch_addMethod · 0.80

Tested by

no test coverage detected