about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread_cond_broadcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_cond_broadcast.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_cond_broadcast.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nptl/sysdeps/pthread/pthread_cond_broadcast.c b/nptl/sysdeps/pthread/pthread_cond_broadcast.c
index 6c3722a9cd..44c3fe6d5f 100644
--- a/nptl/sysdeps/pthread/pthread_cond_broadcast.c
+++ b/nptl/sysdeps/pthread/pthread_cond_broadcast.c
@@ -54,6 +54,10 @@ __pthread_cond_broadcast (cond)
 # error "No valid byte order"
 #endif
 
+      /* Do not use requeue for pshared condvars.  */
+      if (cond->__data.__mutex == (void *) ~0l)
+	goto wake_all;
+
       /* Wake everybody.  */
       pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
       if (__builtin_expect (lll_futex_requeue (futex, 1, INT_MAX,
@@ -61,9 +65,8 @@ __pthread_cond_broadcast (cond)
 			    0))
 	{
 	  /* The requeue functionality is not available.  */
-#ifndef __ASSUME_FUTEX_REQUEUE
+	wake_all:
 	  lll_futex_wake (futex, INT_MAX);
-#endif
 	}
 
       /* That's all.  */