Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1016:7f6e7192dd38
Date: 2014-03-15 08:30 +0100
http://bitbucket.org/pypy/stmgc/changeset/7f6e7192dd38/
Log: Should not have an effect, but better safe than (rarely) sorry
diff --git a/c7/stm/contention.c b/c7/stm/contention.c
--- a/c7/stm/contention.c
+++ b/c7/stm/contention.c
@@ -172,8 +172,14 @@
kind! The shadowstack may not be correct here. It
should not end in a deadlock, because the target thread
is, in principle, guaranteed to call abort_with_mutex()
- very soon.
+ very soon. Just to be on the safe side, make it really
+ impossible for the target thread to later enter the same
+ cond_wait(C_ABORTED) (and thus wait, possibly for us,
+ ending in a deadlock): check again must_abort() first.
*/
+ if (must_abort())
+ abort_with_mutex();
+
dprintf(("contention: wait C_ABORTED...\n"));
cond_wait(C_ABORTED);
dprintf(("contention: done\n"));
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit