Browse Source

TT#14008 don't wake up all threads during non-wait main sleep

Change-Id: Id55cc0e295b586f67d30510ee37572d311a467a2
pull/1388/head
Richard Fuchs 4 years ago
parent
commit
a152f8b07f
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      daemon/aux.c

+ 9
- 7
daemon/aux.c View File

@ -138,14 +138,16 @@ void threads_join_all(bool wait) {
GList *l;
while (1) {
mutex_lock(&thread_wakers_lock);
for (l = thread_wakers; l; l = l->next) {
struct thread_waker *wk = l->data;
mutex_lock(wk->lock);
cond_broadcast(wk->cond);
mutex_unlock(wk->lock);
if (wait) {
mutex_lock(&thread_wakers_lock);
for (l = thread_wakers; l; l = l->next) {
struct thread_waker *wk = l->data;
mutex_lock(wk->lock);
cond_broadcast(wk->cond);
mutex_unlock(wk->lock);
}
mutex_unlock(&thread_wakers_lock);
}
mutex_unlock(&thread_wakers_lock);
mutex_lock(&threads_lists_lock);
while (threads_to_join) {


Loading…
Cancel
Save