summaryrefslogtreecommitdiff
path: root/nptl/pthread_rwlock_wrlock.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-08-01 17:16:42 +0000
committerJakub Jelinek <jakub@redhat.com>2007-08-01 17:16:42 +0000
commite08057b1ff24258dd7460ad81e84491f7a28b424 (patch)
treef63a12d52cbc1796013a84382fe25f57ac675204 /nptl/pthread_rwlock_wrlock.c
parent4baf42dd00e8cafc79e2a3c94ef8effa6ef0a921 (diff)
Updated to fedora-glibc-20070801T1703cvs/fedora-glibc-2_6_90-2
Diffstat (limited to 'nptl/pthread_rwlock_wrlock.c')
-rw-r--r--nptl/pthread_rwlock_wrlock.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/nptl/pthread_rwlock_wrlock.c b/nptl/pthread_rwlock_wrlock.c
index 134b3e95d0..64fe970125 100644
--- a/nptl/pthread_rwlock_wrlock.c
+++ b/nptl/pthread_rwlock_wrlock.c
@@ -32,7 +32,7 @@ __pthread_rwlock_wrlock (rwlock)
int result = 0;
/* Make sure we are along. */
- lll_mutex_lock (rwlock->__data.__lock);
+ lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
while (1)
{
@@ -65,22 +65,21 @@ __pthread_rwlock_wrlock (rwlock)
int waitval = rwlock->__data.__writer_wakeup;
/* Free the lock. */
- lll_mutex_unlock (rwlock->__data.__lock);
+ lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared);
/* Wait for the writer or reader(s) to finish. */
lll_futex_wait (&rwlock->__data.__writer_wakeup, waitval,
- // XYZ check mutex flag
- LLL_SHARED);
+ rwlock->__data.__shared);
/* Get the lock. */
- lll_mutex_lock (rwlock->__data.__lock);
+ lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
/* To start over again, remove the thread from the writer list. */
--rwlock->__data.__nr_writers_queued;
}
/* We are done, free the lock. */
- lll_mutex_unlock (rwlock->__data.__lock);
+ lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared);
return result;
}