From ad4e70da03353444aad95a4fbbd03cef2b750647 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 1 Oct 2013 20:35:28 +0530 Subject: Fix PI mutex check in pthread_cond_broadcast and pthread_cond_signal Fixes BZ #15988. The check had a typo - it checked for PTHREAD_MUTEX_ROBUST_NP instead of PTHREAD_MUTEX_ROBUST_NORMAL_NP. It has now been replaced by the already existing convenience macro USE_REQUEUE_PI. --- nptl/pthread_cond_signal.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'nptl/pthread_cond_signal.c') diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c index 102d0b380c..ffc35dc9e1 100644 --- a/nptl/pthread_cond_signal.c +++ b/nptl/pthread_cond_signal.c @@ -49,14 +49,9 @@ __pthread_cond_signal (cond) #if (defined lll_futex_cmp_requeue_pi \ && defined __ASSUME_REQUEUE_PI) - int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP; pthread_mutex_t *mut = cond->__data.__mutex; - /* Do not use requeue for pshared condvars. */ - if (mut != (void *) ~0l) - pi_flag &= mut->__data.__kind; - - if (__builtin_expect (pi_flag == PTHREAD_MUTEX_PRIO_INHERIT_NP, 0) + if (USE_REQUEUE_PI (mut) /* This can only really fail with a ENOSYS, since nobody can modify futex while we have the cond_lock. */ && lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, 0, -- cgit 1.4.1