This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/23861] rdlock stalls indefinitely on an unlocked pthread rwlock
- From: "prohaska7 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 14 Nov 2018 16:34:53 +0000
- Subject: [Bug nptl/23861] rdlock stalls indefinitely on an unlocked pthread rwlock
- Auto-submitted: auto-generated
- References: <bug-23861-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23861
--- Comment #2 from richard prohaska <prohaska7 at gmail dot com> ---
This patch sets r = __readers in the inner loop as suggested and runs the test
program successfully.
diff --git a/nptl/pthread_rwlock_common.c b/nptl/pthread_rwlock_common.c
index a290d08332..8c970d19c3 100644
--- a/nptl/pthread_rwlock_common.c
+++ b/nptl/pthread_rwlock_common.c
@@ -314,7 +314,7 @@ __pthread_rwlock_rdlock_full (pthread_rwlock_t *rwlock,
harmless because the flag is just about the state of
__readers, and all threads set the flag under the same
conditions. */
- while ((atomic_load_relaxed (&rwlock->__data.__readers)
+ while (((r = atomic_load_relaxed (&rwlock->__data.__readers))
& PTHREAD_RWLOCK_RWAITING) != 0)
{
int private = __pthread_rwlock_get_private (rwlock);
--
You are receiving this mail because:
You are on the CC list for the bug.