Created
October 25, 2017 17:35
-
-
Save dloman/cd1d1109071a11ee48e40c12bf914810 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::mutex Mutex; | |
std::condition_variable cv; | |
std::unique_lock<std::mutex> Lock(Mutex); | |
for (auto i = 0; i < 10; ++i) | |
{ | |
auto a = cv.wait_for(Lock, std::chrono::milliseconds(10)); | |
if (a == std::cv_status::no_timeout) | |
{ | |
return 1; | |
} | |
} | |
return 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment