std::thread 四:异步(async)

*:如果 std::async 中传递参数 std::lunnch::deferred ,就需要等待调用 get() 或者 wait() 才会执行,并且代码非子线程运行,而是在主线程中执行 #include <iostream> #include <thread> #include <mutex>
posted @ 2023-06-18 23:12  十一的杂文录  阅读(43)  评论(0编辑  收藏  举报