在posix线程api中,通过pthread_self(void) 函数获取当前线程的id

线程id的类型为pthread_t

pthread.h 第267行声明了pthread_self (void)的函数,格式如下

extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));

在pthreadtypes.h第50行定义了:

typedef unsigned long int pthread_t;//声明为无符号长整型

posted on 2013-11-12 22:53  heidsoft  阅读(3468)  评论(0编辑  收藏  举报