From 69431c9a21f7393f34330a27df1630520930789e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 May 2003 02:47:39 +0000 Subject: Update. 2003-05-25 Ulrich Drepper * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_FUTEX_REQUEUE for >= 2.5.70. * math/test-fenv.c (feexcp_nomask_test): Fix comment. --- nptl/sysdeps/pthread/pthread_cond_broadcast.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'nptl/sysdeps/pthread/pthread_cond_broadcast.c') diff --git a/nptl/sysdeps/pthread/pthread_cond_broadcast.c b/nptl/sysdeps/pthread/pthread_cond_broadcast.c index 1076fe3c50..f34f58cc99 100644 --- a/nptl/sysdeps/pthread/pthread_cond_broadcast.c +++ b/nptl/sysdeps/pthread/pthread_cond_broadcast.c @@ -25,6 +25,7 @@ #include #include +#include int @@ -54,7 +55,16 @@ __pthread_cond_broadcast (cond) #endif /* Wake everybody. */ - lll_futex_wake (futex, INT_MAX); + pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex; + if (__builtin_expect (lll_futex_requeue (futex, 1, MAX_INT, + &mut->__data.__lock) == -EINVAL, + 0)) + { + /* The requeue functionality is not available. */ +#ifndef __ASSUME_FUTEX_REQUEUE + lll_futex_wake (futex, MAX_INT); +#endif + } /* That's all. */ return 0; -- cgit v1.2.3-70-g09d2