diff options
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c')
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c b/libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c index 9cae8b6c2..a7ef71a11 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -27,7 +27,7 @@ int __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) { - lll_mutex_lock (rwlock->__data.__lock); + lll_lock (rwlock->__data.__lock, rwlock->__data.__shared); if (rwlock->__data.__writer) rwlock->__data.__writer = 0; else @@ -37,19 +37,21 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) if (rwlock->__data.__nr_writers_queued) { ++rwlock->__data.__writer_wakeup; - lll_mutex_unlock (rwlock->__data.__lock); - lll_futex_wake (&rwlock->__data.__writer_wakeup, 1); + lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared); + lll_futex_wake (&rwlock->__data.__writer_wakeup, 1, + rwlock->__data.__shared); return 0; } else if (rwlock->__data.__nr_readers_queued) { ++rwlock->__data.__readers_wakeup; - lll_mutex_unlock (rwlock->__data.__lock); - lll_futex_wake (&rwlock->__data.__readers_wakeup, INT_MAX); + lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared); + lll_futex_wake (&rwlock->__data.__readers_wakeup, INT_MAX, + rwlock->__data.__shared); return 0; } } - lll_mutex_unlock (rwlock->__data.__lock); + lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared); return 0; } |