Blocks until the controller thread notifies. Must be called from a test thread.
| 1468 | // Blocks until the controller thread notifies. Must be called from a test |
| 1469 | // thread. |
| 1470 | void WaitForNotification() { |
| 1471 | for (;;) { |
| 1472 | pthread_mutex_lock(&mutex_); |
| 1473 | const bool notified = notified_; |
| 1474 | pthread_mutex_unlock(&mutex_); |
| 1475 | if (notified) |
| 1476 | break; |
| 1477 | SleepMilliseconds(10); |
| 1478 | } |
| 1479 | } |
| 1480 | |
| 1481 | private: |
| 1482 | pthread_mutex_t mutex_; |
no test coverage detected