C++两个线程交替打印

#include <iostream> #include <condition_variable> using namespace std; mutex mtx; condition_variable cond_var; bool flag = true; void fun1() { while (1) { this_thread::sleep_for(chrono::seconds(
相关文章
相关标签/搜索