- std thread 官方没有这个api
- linux一般用pthread_getthreadid_np 或者 prctl 来解决。
pthread_getthreadid_np
pthread_getthreadid_np wasn’t on my Mac os x. pthread_t is an opaque type. Don’t beat your head over it. Just assign it to void* and call it good. If you need to printf use %p.
linux 似乎很容易
-
比如:
pthread_setname_np(pthread_self(),