/*exit_join_id.c*/
#include<pthread.h>
#include<stdio.h>
void* eji(void* agr)
{
printf("here is eji
");
printf("PID= %u",(unsigned int)pthread_self());
pthread_exit("here all done!
");
}
int main(int argc, char** argv)
{
pthread_t pid;
int ret;
void* j_ret;
ret=pthread_create(&pid,NULL,eji,NULL);
if(ret)
{
printf("pthread_create failed
");
return -1;
}
ret=pthread_join(pid,&j_ret);
if(ret)
{
printf("pthread_join failed
");
return -1;
}
printf("the return value is %s",(char*)j_ret);
return 0;
}