#include<stdio.h>
#include<pthread.h>
#include<Windows.h>
#include<signal.h>
#include<process.h>//getpid函数的使用
#pragma comment(lib, "pthreadVC2.lib") //必须加上这句
void*thread_func(void*arg)
{
printf("thread id=%lu\n",pthread_self());
return arg;
}
int main(void){
pid_t pid;
pthread_t tid;
pid = getpid();
printf("process id=%lu\n", pid);
pthread_create(&tid, NULL, thread_func, NULL);
pthread_join(tid,NULL);
return 0;
}