上一页 1 2 3 4 5 6 7 8 9 ··· 112 下一页
摘要: #include <iostream> #include <future> int mythread() { std::cout << "mythread " << std::this_thread::get_id() << std::endl; std::chrono::milliseconds 阅读全文
posted @ 2022-08-08 18:47 thomas_blog 阅读(621) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <future> void mythread(std::promise<int> &promise, int arg) { std::cout << "mythread " << std::this_thread::get_id() << s 阅读全文
posted @ 2022-08-08 16:25 thomas_blog 阅读(253) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <future> int mythread(int arg) { std::cout << "mythread " << std::this_thread::get_id() << std::endl; std::cout << "arg " 阅读全文
posted @ 2022-08-08 15:41 thomas_blog 阅读(36) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <future> int mythread() { std::cout << "mythread " << std::this_thread::get_id() << std::endl; std::chrono::milliseconds 阅读全文
posted @ 2022-08-08 14:55 thomas_blog 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> #include <thread> #include <condition_variable> std::mutex mutex; std::condition_variable cond; void in_msg() { w 阅读全文
posted @ 2022-08-07 22:12 thomas_blog 阅读(23) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> using namespace std; class MyInstance { MyInstance(){} public: static MyInstance *getInstance() { std::call_once( 阅读全文
posted @ 2022-08-07 15:46 thomas_blog 阅读(161) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; class MyInstance { MyInstance(){} public: static MyInstance *getInstance() { if(m_instance == NULL) { m_insta 阅读全文
posted @ 2022-08-07 15:11 thomas_blog 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex); std: 阅读全文
posted @ 2022-08-07 13:26 thomas_blog 阅读(84) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex, std:: 阅读全文
posted @ 2022-08-07 13:19 thomas_blog 阅读(70) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex, std:: 阅读全文
posted @ 2022-08-07 13:08 thomas_blog 阅读(91) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 112 下一页