1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
* 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:
Ulrich Drepper
2007-05-18 00:55:10 +00:00
parent bec51a302f
commit 113ad5fc91
6 changed files with 114 additions and 10 deletions

View File

@ -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)
{