多线程编程指南

获取线程标识符

请使用 pthread_self(3C) 获取调用线程的 thread identifier

pthread_self 语法

pthread_t	 pthread_self(void);
#include <pthread.h>



pthread_t tid;



tid = pthread_self();

pthread_self 返回值

pthread_self() 返回调用线程的 thread identifier