摘要:        
1 /* 2 * 话题1:基于“转移线程的所有权”,改进 thread_guard 类, 确保 std::thread 可以被 join或detach。 3 * 类 Scoped_thread 的构造函数把参数传递的 std::thread 拥有的所有权转移到自身成员变量上。 4 * 如果参数传递的    阅读全文
posted @ 2021-10-01 11:32
我是张洪铭我是熊博士
阅读(97)
评论(0)
推荐(0)
            
        
        
摘要:        
1 #include <QCoreApplication> 2 #include <thread> 3 #include <iostream> 4 5 /* 6 * 话题1:转移线程的所有权。 7 * std::thread 构造函数需传入一个函数或可调用对象, 每一个 std::thread 都关    阅读全文
posted @ 2021-10-01 10:48
我是张洪铭我是熊博士
阅读(97)
评论(0)
推荐(0)
    
                    
                
浙公网安备 33010602011771号