摘要:
一、std::recursive_mutex 递归的独占互斥量 1.std::mutex : 独占互斥量,自己lock了,别人就不能lock了。 2.std::recursive_mutex 递归的独占互斥量 : 允许同一个线程,同一个互斥量多次被 lock(),效率上比 mutex 要差一点。如果 阅读全文
posted @ 2022-12-15 20:49
repinkply
阅读(113)
评论(0)
推荐(0)
摘要:
1.从上节课的一个demo说起。 #include <iostream> #include <future> #include <vector> #include <atomic> #include <thread> using namespace std; std::atomic<int> g_m 阅读全文
posted @ 2022-12-15 15:49
repinkply
阅读(104)
评论(0)
推荐(0)