Skip to content
Snippets Groups Projects
Commit 51dec77e authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

implement fix suggested by peter.

parent b875704d
Branches
Tags
2 merge requests!136Master,!122Rewait fixes
......@@ -1011,6 +1011,7 @@ void scheduler_start(struct scheduler *s, unsigned int mask,
/* Wait for the rewait tasks to have executed. */
pthread_mutex_lock(&s->sleep_mutex);
pthread_cond_broadcast(&s->sleep_cond);
while (s->waiting > waiting_old) {
pthread_cond_wait(&s->sleep_cond, &s->sleep_mutex);
}
......@@ -1032,6 +1033,11 @@ void scheduler_start(struct scheduler *s, unsigned int mask,
}
}
/* To be safe, fire of one last sleep_cond in a safe way. */
pthread_mutex_lock(&s->sleep_mutex);
pthread_cond_broadcast(&s->sleep_cond);
pthread_mutex_unlock(&s->sleep_mutex);
// message( "enqueueing tasks took %.3f %s." ,
// clocks_from_ticks( getticks() - tic ), clocks_getunit());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment