summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-08-31 06:53:32 +0000
committerJakub Jelinek <jakub@redhat.com>2006-08-31 06:53:32 +0000
commit936bb2647a835e63e99fa2d1590ab1e14aab4712 (patch)
treee0fcf856a8a2051f8878dd4c8eca215bc549de13 /nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
parent2455d11258712bbab8a52c7951301924a483a295 (diff)
Updated to fedora-glibc-20060831T0640cvs/fedora-glibc-2_4_90-27
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_rwlock_wrlock.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_wrlock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
index 822aeed79c..4d967f2496 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -37,7 +37,9 @@ __pthread_rwlock_wrlock (rwlock)
while (1)
{
/* Get the rwlock if there is no writer and no reader. */
- if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
+ if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0
+ && (rwlock->__data.__flags != 0
+ || rwlock->__data.__nr_readers_queued == 0))
{
/* Mark self as writer. */
rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);