diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-05-21 20:01:15 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-05-21 20:01:15 +0000 |
commit | 75831cc48d3fef9b0bb247aabbcdaceef85efa23 (patch) | |
tree | 49952b4916fa5d21f944970fa0ff5392742e9378 /nptl/pthread_mutex_timedlock.c | |
parent | 473e6b3f8fcf9c937d5a85da70b95f5c13f4a28f (diff) |
Backported selected fixes from 2007-05-{17,18,21}.cvs/fedora-glibc-2_6-2
Diffstat (limited to 'nptl/pthread_mutex_timedlock.c')
-rw-r--r-- | nptl/pthread_mutex_timedlock.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c index c8e6b8507a..8fd681c6ef 100644 --- a/nptl/pthread_mutex_timedlock.c +++ b/nptl/pthread_mutex_timedlock.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. @@ -119,9 +119,11 @@ pthread_mutex_timedlock (mutex, abstime) if ((oldval & FUTEX_OWNER_DIED) != 0) { /* The previous owner died. Try locking the mutex. */ - int newval + int newval = id | (oldval & FUTEX_WAITERS); + + newval = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock, - id, oldval); + newval, oldval); if (newval != oldval) { oldval = newval; |