头文件 #include <pthread.h> 函数原型 pthread_t pthread_self(void); 函数作用:获得线程自身的ID。pthread_t的类型为unsigned long int,所以在打印的时候要使用%lu方式,否则将产生奇怪的结果。 功能 获取当前调用线程的 thread identifier(标识号). 相关文章: 2022-12-23 2022-12-23 2022-12-23 2022-12-23 2021-11-11 2022-12-23 2022-12-23