| 94 | } |
| 95 | |
| 96 | bool wait_or_timeout ( |
| 97 | unsigned long milliseconds |
| 98 | ) const |
| 99 | { |
| 100 | std::unique_lock<std::mutex> cs(m.cs, std::adopt_lock); |
| 101 | auto status = cv.wait_until(cs, std::chrono::system_clock::now() + std::chrono::milliseconds(milliseconds)); |
| 102 | // Make sure we don't actually modify the mutex. Since the calling code will have locked |
| 103 | // it and it should remain locked. |
| 104 | cs.release(); |
| 105 | return status == std::cv_status::no_timeout; |
| 106 | } |
| 107 | |
| 108 | void signal ( |
| 109 | ) const |