Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout<<" executando funcao tarefas - thread= "<< p <<endl;
- __sync_fetch_and_add(&arrive[p],1);
- cout << " valor de arrive " << p <<" "<< arrive[p] <<" alterado por thread " << endl;
- while(proceed[p]==0);
- printf("%d sou a thread num=%d e estou na barreira\n",p,p);
- printf("%d sou a thread num=%d e passei da barreira.\n",p,p);
- proceed[p] = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement