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();
posted @ 2023-04-29 18:42  Theseus‘Ship  阅读(281)  评论(0编辑  收藏  举报
Live2D