POSIX threads problem

Joined
Oct 17, 2010
Messages
2
Reaction score
0
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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top