I have multiple threads, and I want each thread to wait for every others to complete at certain point in the code before proceeding as following:
void *run() {
for (i=0;i<1000;i++){
do_1st();
// sync() all stop here wait for all then resume
do_2nd();
}
}
I tried to use pthread_cond_wait.. but It seems very complicated.
Is there any easy wait to do this ?
Thank you