Skip to content
Snippets Groups Projects
Commit 2c3dc9d5 authored by Alexandru BRĂSLAŞU's avatar Alexandru BRĂSLAŞU
Browse files

Tema

parent 9c748586
No related branches found
No related tags found
No related merge requests found
Pipeline #44270 canceled
......@@ -115,12 +115,10 @@ void wait_for_completion(os_threadpool_t *tp)
pthread_cond_wait(&tp->WakeUp, &tp->mutexCoada);
tp->stop = 1;
pthread_mutex_unlock(&tp->mutexCoada);
pthread_mutex_lock(&tp->mutexCoada);
while (tp->threadsOut < tp->num_threads) {
pthread_cond_broadcast(&tp->Wait);
pthread_cond_wait(&tp->WakeUp, &tp->mutexCoada);
}
pthread_mutex_unlock(&tp->mutexCoada);
/* Join all worker threads. */
for (unsigned int i = 0; i < tp->num_threads; i++)
pthread_join(tp->threads[i], NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment