mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
[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.
This commit is contained in:
@ -84,9 +84,11 @@ __pthread_mutex_trylock (mutex)
|
||||
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user