摘要: wait_until(阻塞当前线程,直到条件变量被唤醒,或直到抵达指定时间点) include include include include include using namespace std::chrono_literals; std::condition_variable cv; std: 阅读全文
posted @ 2019-05-22 10:05 JohnRed 阅读(3563) 评论(0) 推荐(1) 编辑
摘要: ###wait_for(阻塞当前线程,直到条件变量被唤醒,或到指定时限时长后) #include <iostream> #include <string> #include <sstream> #include <thread> #include <mutex> #include <conditio 阅读全文
posted @ 2019-05-22 10:02 JohnRed 阅读(7679) 评论(0) 推荐(0) 编辑
摘要: wait(阻塞当前线程,直到条件变量被唤醒) include include include include include std::mutex m; std::condition_variable cv; std::string data; bool ready = false; bool pr 阅读全文
posted @ 2019-05-22 10:01 JohnRed 阅读(2991) 评论(0) 推荐(0) 编辑