C++ Concurrency and Multithreading Notes (2)

The concept of thread id: id is a number, each thread (whether it is a main thread or a sub-thread) actually corresponds to a number, and each thread corresponds to this;
//In other words, different threads, its Thread id (number) must be different;
/Thread id can be obtained with functions in the C++ standard library.
std::this_thread::get_id() to get it.
Pass the class object as a thread parameter

Guess you like

Origin blog.csdn.net/shanlijia/article/details/107145106