| 355 | } |
| 356 | |
| 357 | void* 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 | |
| 372 | void* disturb_thread(void* arg) { |
| 373 | BroadcastArg* ba = (BroadcastArg*)arg; |
nothing calls this directly
no test coverage detected