summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2010-02-16 12:27:18 -0800
committerAustin Foxley <austinf@cetoncorp.com>2010-02-16 12:27:18 -0800
commita032a6587011cbdac8c2f7e11f15dc4e592bbb55 (patch)
treeb8d8dfc6abf0168e098223c2134a3e4bd7640942 /libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c
parent70f1d42b13a741f603472f405299e5d2938aa728 (diff)
mass sync with glibc nptl
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c')
-rw-r--r--libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.c16
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;
}