* [PATCH] Fix pthread_cond_wait bug on !i386 !x86_64
@ 2004-05-24 11:27 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-05-24 11:27 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
I hope this is the only cause of the random failures of tst-cond{16,17,18}
on pthread_cond_*.c using architectures.
Certainly on 7way PPC I managed to run 71 tst-cond18 runs without a failure
(while previously it took at most 20 to fail) and so far 16 tst-cond16 runs.
2004-05-21 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
__broadcast_seq with bc_seq after acquiring internal lock instead of
before it.
--- libc/nptl/sysdeps/pthread/pthread_cond_wait.c.jj 2004-05-19 22:58:46.000000000 +0200
+++ libc/nptl/sysdeps/pthread/pthread_cond_wait.c 2004-05-21 17:30:54.654099109 +0200
@@ -143,13 +143,13 @@ __pthread_cond_wait (cond, mutex)
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
+ /* We are going to look at shared data again, so get the lock. */
+ lll_mutex_lock (cond->__data.__lock);
+
/* If a broadcast happened, we are done. */
if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
goto bc_out;
- /* We are going to look at shared data again, so get the lock. */
- lll_mutex_lock (cond->__data.__lock);
-
/* Check whether we are eligible for wakeup. */
val = cond->__data.__wakeup_seq;
}
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-21 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-24 11:27 [PATCH] Fix pthread_cond_wait bug on !i386 !x86_64 Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).