Trương Duy Bằng
New member
Which one of the following string will print first by this program?
A. Linux
B. 123hoidap
C. it can not be predicted
D. none of the mentioned
Code:
#include<stdio.h>
#include<pthread.h>
void *fun_t(void *arg);
void *fun_t(void *arg)
{
printf("123hoidap\n");
pthread_exit("Bye");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
perror("pthread_create");
printf("Linux\n");
if(pthread_join(pt,&res_t) != 0)
perror("pthread_join");
return 0;
}
B. 123hoidap
C. it can not be predicted
D. none of the mentioned