C++11线程库std::thread中提取线程id
std::thread::id id = std::this_thread::get_id();
std::cout << "cout ----- id : " << id << “ins[0]=” << ins[0] << std::endl;
callvec(ins, &out);
std::cout << "cout ----- id : " << id << “out[0]=” << out[0] << “, out[63]=” << out[63] << std::endl;
这篇博客详细介绍了如何在C++11的线程库中提取并使用线程ID。示例代码展示了如何通过`std::this_thread::get_id()`获取当前线程ID,并在不同上下文中输出,这对于理解和调试多线程程序非常关键。
2225

被折叠的 条评论
为什么被折叠?



