pthread_self

头文件

#include <pthread.h>

函数原型

pthread_t pthread_self(void);

函数作用:获得线程自身的ID。pthread_t的类型为unsigned long int,所以在打印的时候要使用%lu方式,否则将产生奇怪的结果。

功能

获取当前调用线程的 thread identifier(标识号).
posted @ 2012-02-16 22:11  dzqabc  阅读(2102)  评论(1编辑  收藏  举报