Like "cv->wait(*mu)", except that it only waits for up to "ms" milliseconds. Returns kCond_Timeout if the timeout expired without this thread noticing a signal on the condition variable. Otherwise may return either kCond_Timeout or kCond_MaybeNotified
| 242 | // thread noticing a signal on the condition variable. Otherwise may |
| 243 | // return either kCond_Timeout or kCond_MaybeNotified |
| 244 | inline ConditionResult WaitForMilliseconds(mutex_lock* mu, |
| 245 | condition_variable* cv, int64 ms) { |
| 246 | std::cv_status s = cv->wait_for(*mu, std::chrono::milliseconds(ms)); |
| 247 | return (s == std::cv_status::timeout) ? kCond_Timeout : kCond_MaybeNotified; |
| 248 | } |
| 249 | |
| 250 | // ------------------------------------------------------------ |
| 251 | // Implementation details follow. Clients should ignore them. |