commtechs: BUGFIX wait threads to be initialized
This commit is contained in:
parent
97fb64709f
commit
5e3a7f6ce0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue