summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-cond-brdcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/pt-cond-brdcast.c')
-rw-r--r--sysdeps/generic/pt-cond-brdcast.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sysdeps/generic/pt-cond-brdcast.c b/sysdeps/generic/pt-cond-brdcast.c
index 999cc2d..ad44f83 100644
--- a/sysdeps/generic/pt-cond-brdcast.c
+++ b/sysdeps/generic/pt-cond-brdcast.c
@@ -28,16 +28,12 @@ __pthread_cond_broadcast (pthread_cond_t *cond)
struct __pthread *wakeup;
__pthread_spin_lock (&cond->__lock);
+ __pthread_dequeuing_iterate (cond->__queue, wakeup)
+ __pthread_wakeup (wakeup);
- wakeup = cond->__queue;
cond->__queue = NULL;
__pthread_spin_unlock (&cond->__lock);
- /* We can safely walk the list of waiting threads without holding
- the lock since it is now decoupled from the condition. */
- __pthread_dequeuing_iterate (wakeup, wakeup)
- __pthread_wakeup (wakeup);
-
return 0;
}