Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r46531:20bbf61dca0f
Date: 2011-08-16 12:05 +0200
http://bitbucket.org/pypy/pypy/changeset/20bbf61dca0f/

Log:    Found (I think) the source of the occasional issue in this threading
        test.

diff --git a/pypy/module/thread/test/test_ll_thread.py 
b/pypy/module/thread/test/test_ll_thread.py
--- a/pypy/module/thread/test/test_ll_thread.py
+++ b/pypy/module/thread/test/test_ll_thread.py
@@ -52,6 +52,13 @@
             assert get_ident() == state.z.ident
             state.seen_value = state.z.value
             state.z = None
+            # I think that we would need here a memory barrier in order
+            # to make the test pass reliably.  The issue is that the
+            # main thread may see 'state.done = 1' before seeing the
+            # effect of the other assignments done above.  For now let's
+            # emulate the write barrier by doing a system call and
+            # waiting a bit...
+            time.sleep(0.012)
             state.done = 1
 
         def g(i):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to