summaryrefslogtreecommitdiff
path: root/nptl/pthread_mutex_lock.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-18 00:55:10 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-18 00:55:10 +0000
commit113ad5fc9192340269d2ce19b896d51309e785ea (patch)
tree0028c672ecec9626a07fa3dfc5bcba89b690d2f4 /nptl/pthread_mutex_lock.c
parentbec51a302f0e7046fcb8c4fcd13ea2969a43a9b7 (diff)
[BZ #4512]
* pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner is detected. * pthread_mutex_timedlock.c: Likewise. * pthread_mutex_trylock.c: Likewise. Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>. * Makefile (tests): Add tst-robust9 and tst-robustpi9. * tst-robust9.c: New file. * tst-robustpi9.c: New file.
Diffstat (limited to 'nptl/pthread_mutex_lock.c')
-rw-r--r--nptl/pthread_mutex_lock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index 52cc47f4cc..1c3ee4fe25 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -127,6 +127,8 @@ __pthread_mutex_lock (mutex)
int newval = id;
#ifdef NO_INCR
newval |= FUTEX_WAITERS;
+#else
+ newval |= (oldval & FUTEX_WAITERS);
#endif
newval