C++11’s standard library contains
which allows threads to be created. However, the Windows api requires an ID for some functions (PostThreadMessa
The thread::id
class only allows comparison between id
s and an output. It does not provide a means to access the actual underlying id
. You could try outputting it to a stringstream
and then parsing it back in, I guess.
Use the member function native_handle(). It provides the native thread handle. Then you can call GetThreadId()
on it.