We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4532f81 commit e3da46dCopy full SHA for e3da46d
cpp/11.cpp
@@ -702,6 +702,12 @@ void condition_variable_11()
702
cv.notify_one();
703
});
704
// locking block
705
+ {
706
+ unique_lock<mutex> lk(m);
707
+ // https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for
708
+ assert(cv.wait_for(lk, chrono::milliseconds(0)) == cv_status::timeout);
709
+ assert(!cv.wait_for(lk, chrono::milliseconds(0),[]{return false;}));
710
+ }
711
{
712
unique_lock<mutex> lk(m);
713
stage = 1;
0 commit comments