std::thread - naming your thread

后端 未结 5 2055
谎友^
谎友^ 2020-12-08 04:02

The new C++ has this std::thread type. Works like a charm. Now I would like to give each thread a name for more easy debugging (like java allows you to). With pthreads I wou

5条回答
  •  佛祖请我去吃肉
    2020-12-08 04:20

    You can use std::thread::native_handle to get the underlaying implementation defined thread. There is no standard function for that natively.

    You can find an example here.

提交回复
热议问题