How to get the winapi id of a thread that has been created using the standard library?

后端 未结 2 1343
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 03:46

C++11’s standard library contains which allows threads to be created. However, the Windows api requires an ID for some functions (PostThreadMessa

2条回答
  •  日久生厌
    2021-01-18 04:14

    The thread::id class only allows comparison between ids 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.

提交回复
热议问题