MCPcopy Create free account
hub / github.com/davisking/dlib / wait_or_timeout

Method wait_or_timeout

dlib/threads/threads_kernel_1.h:96–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 8

connect_threadMethod · 0.45
transmit_threadMethod · 0.45
enqueue_or_timeoutMethod · 0.45
dequeue_or_timeoutMethod · 0.45
thread_starterFunction · 0.45
threadMethod · 0.45
threadMethod · 0.45

Calls 1

releaseMethod · 0.45

Tested by 1