From 8833066b122427710a9e14a888ce6cfa862332d3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 31 Jul 2007 17:46:17 +0000 Subject: Updated to fedora-glibc-20070731T1624 --- nptl/sysdeps/unix/sysv/linux/lowlevellock.c | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'nptl/sysdeps/unix/sysv/linux/lowlevellock.c') diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c index 932e27300f..ab7f605f0c 100644 --- a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c +++ b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c @@ -1,5 +1,5 @@ /* low level locking for pthread library. Generic futex-using version. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras , 2003. @@ -31,7 +31,9 @@ __lll_lock_wait (int *futex) { int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); if (oldval != 0) - lll_futex_wait (futex, 2); + lll_futex_wait (futex, 2, + // XYZ check mutex flag + LLL_SHARED); } while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); } @@ -68,7 +70,9 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime) /* Wait. */ int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); if (oldval != 0) - lll_futex_timed_wait (futex, 2, &rt); + lll_futex_timed_wait (futex, 2, &rt, + // XYZ check mutex flag + LLL_SHARED); } while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); @@ -76,20 +80,8 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime) } -/* These don't get included in libc.so */ +/* This function doesn't get included in libc.so */ #ifdef IS_IN_libpthread -int -lll_unlock_wake_cb (int *futex) -{ - int val = atomic_exchange_rel (futex, 0); - - if (__builtin_expect (val > 1, 0)) - lll_futex_wake (futex, 1); - - return 0; -} - - int __lll_timedwait_tid (int *tidp, const struct timespec *abstime) { @@ -120,12 +112,12 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime) if (rt.tv_sec < 0) return ETIMEDOUT; - /* Wait until thread terminates. */ - if (lll_futex_timed_wait (tidp, tid, &rt) == -ETIMEDOUT) + /* Wait until thread terminates. The kernel so far does not use + the private futex operations for this. */ + if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT) return ETIMEDOUT; } return 0; } - #endif -- cgit v1.2.3