MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WaitForMilliseconds

Function WaitForMilliseconds

tensorflow/core/platform/mutex.h:244–248  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

242// thread noticing a signal on the condition variable. Otherwise may
243// return either kCond_Timeout or kCond_MaybeNotified
244inline 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.

Callers 4

AllocateRawMethod · 0.85
ThreadLogicMethod · 0.85
TESTFunction · 0.85
GCMethod · 0.85

Calls 1

wait_forMethod · 0.80

Tested by 1

TESTFunction · 0.68