commtechs: BUGFIX wait threads to be initialized

This commit is contained in:
Thomas Preud'homme 2009-07-07 16:08:00 +02:00 committed by Thomas Preud'homme
parent 97fb64709f
commit 5e3a7f6ce0
1 changed files with 7 additions and 4 deletions

View File

@ -58,10 +58,13 @@ int init_producer_thread(void)
pthread_mutex_unlock(&init_lock);
return -1;
}
pthread_mutex_lock(&init_lock);
init = 1;
pthread_cond_signal(&init_cond);
pthread_mutex_unlock(&init_lock);
if (thread_num == nb_prod - 1)
{
pthread_mutex_lock(&init_lock);
init = 1;
pthread_cond_signal(&init_cond);
pthread_mutex_unlock(&init_lock);
}
return 0;
}