http://blog.sina.com.cn/s/blog_6572515e0100y4l3.html
线程标识
函数原型:
#include <pthread.h>
pthread_t pthread_self(void);
pid_t getpid(void);getpid()用来取得目前进程的进程识别码
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void *create(void *arg)
{
}
int main(int argc,char *argv[])
{
}
执行结果:
Main thread is starting ...
The main process's pid is 3307
New thread ....
This thread's id is 3086347152
The process pid is 3307