hello,
i create two threads(POSIX) but always my program join in the first thread and ignore the other. I can't understand it. Here is my code:
void *play1(void *arg){..}
void *play2(void *arg){..}
int main(){
pthread_t player1,player2;
pthread_create(&player1,NULL,play1,(void *)0);
pthread_create(&player2,NULL,play2,(void *)1);
pthread_setconcurrency(2);
pthread_join(player1, NULL);
pthread_join(player2, NULL);
return 0;
}
i create two threads(POSIX) but always my program join in the first thread and ignore the other. I can't understand it. Here is my code:
void *play1(void *arg){..}
void *play2(void *arg){..}
int main(){
pthread_t player1,player2;
pthread_create(&player1,NULL,play1,(void *)0);
pthread_create(&player2,NULL,play2,(void *)1);
pthread_setconcurrency(2);
pthread_join(player1, NULL);
pthread_join(player2, NULL);
return 0;
}