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

Function broadcast_thread

test/bthread_cond_unittest.cpp:357–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357void* broadcast_thread(void* arg) {
358 BroadcastArg* ba = (BroadcastArg*)arg;
359 //int local_round = 0;
360 while (ba->rounds > 0) {
361 std::unique_lock<bthread::Mutex> lck(ba->mutex);
362 while (ba->cur_waiter < ba->nwaiter) {
363 ba->broadcast_cond.wait(lck);
364 }
365 ba->cur_waiter = 0;
366 --ba->rounds;
367 ba->wait_cond.notify_all();
368 }
369 return NULL;
370}
371
372void* disturb_thread(void* arg) {
373 BroadcastArg* ba = (BroadcastArg*)arg;

Callers

nothing calls this directly

Calls 2

notify_allMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected