How do I get a thread ID from an arbitrary pthread_t?

前端 未结 5 657
轮回少年
轮回少年 2020-11-27 16:13

I have a pthread_t, and I\'d like to change its CPU affinity. The problem is that I\'m using glibc 2.3.2, which doesn\'t have pthread_setaffinity_np(). That\'s OK, though, b

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 16:34

    In glibc 2.24 the pthread_t returned is just the pointer to an opaque struct pthread. You can look up the definition in nptl/descr.h.

提交回复
热议问题