diff options
author | Neal H. Walfield <neal@gnu.org> | 2008-10-02 12:00:44 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-04-08 00:03:40 +0200 |
commit | 4ce7b9d66e58f2330f5428e63f70a79a0eb225ec (patch) | |
tree | 92b9c325d9b3fe500dc91baf5c81bd85d1c30441 /sysdeps/generic/pt-mutex-unlock.c | |
parent | 67401f7b39a10eb3c4eedabecf180ff587d6c95b (diff) |
2008-10-02 Neal H. Walfield <neal@gnu.org>
* sysdeps/generic/pt-mutex-timedlock.c
(__pthread_mutex_timedlock_internal) [! ALWAYS_TRACK_MUTEX_OWNER]:
Don't update MUTEX->OWNER or assert MUTEX->OWNER for normal
mutexes.
* sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock)
[! ALWAYS_TRACK_MUTEX_OWNER]: Don't update MUTEX->OWNER or assert
MUTEX->OWNER for normal mutexes.
* sysdeps/generic/pt-mutex-transfer-np.c
(__pthread_mutex_transfer_np) [! ALWAYS_TRACK_MUTEX_OWNER]: Don't
update MUTEX->OWNER for normal mutexes.
Diffstat (limited to 'sysdeps/generic/pt-mutex-unlock.c')
-rw-r--r-- | sysdeps/generic/pt-mutex-unlock.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/generic/pt-mutex-unlock.c b/sysdeps/generic/pt-mutex-unlock.c index 492dfcb5..7645fd4c 100644 --- a/sysdeps/generic/pt-mutex-unlock.c +++ b/sysdeps/generic/pt-mutex-unlock.c @@ -33,13 +33,15 @@ __pthread_mutex_unlock (pthread_mutex_t *mutex) if (! mutex->attr || mutex->attr->mutex_type == PTHREAD_MUTEX_NORMAL) { -#ifndef NDEBUG +#if defined(ALWAYS_TRACK_MUTEX_OWNER) +# ifndef NDEBUG if (_pthread_self ()) { assert (mutex->owner); assert (mutex->owner == _pthread_self ()); mutex->owner = NULL; } +# endif #endif } else @@ -79,7 +81,12 @@ __pthread_mutex_unlock (pthread_mutex_t *mutex) __pthread_dequeue (wakeup); #ifndef NDEBUG - mutex->owner = wakeup; +# if !defined (ALWAYS_TRACK_MUTEX_OWNER) + if (mutex->attr && mutex->attr->mutex_type != PTHREAD_MUTEX_NORMAL) +# endif + { + mutex->owner = wakeup; + } #endif /* We do not unlock MUTEX->held: we are transferring the ownership |