std::thread::id master_thread;
void some_core_part_of_algorithm() {
if (std::this_thread::get_id() == master_thread) {
do_master_work();
} else {
do_common_work();
}
}
获取线程id
Comments 0
Sign in to comment and like
← More postsThat’s all for now. Thanks for reading.
No comments yet.