C++-std::this_thread::get_id()-获取线程id
C++-std::this_thread::get_id()
-获取线程id
std::this_thread::get_id()
头文件:<thread>
函数:std::this_thread::get_id()
用例:std::thread::id thread_id = std::this_thread::get_id();
std::thread
对象的成员函数get_id()
头文件:<thread>
函数:std::thread::id get_id()
用例:通过调用std::thread对象的成员函数get_id()来直接获取
#include <thread>
std::thread t;
t.get_id();
本文来自博客园,作者:Theseus‘Ship,转载请注明原文链接:https://www.cnblogs.com/yongchao/p/17364358.html