[pypy-commit] pypy stm-gc: Last fix. Now it runs :-)

arigo noreply at buildbot.pypy.org
Fri Feb 10 16:17:25 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r52356:c950d5bc52c3
Date: 2012-02-10 16:17 +0100
http://bitbucket.org/pypy/pypy/changeset/c950d5bc52c3/

Log:	Last fix. Now it runs :-)

diff --git a/pypy/translator/stm/test/targetdemo.py b/pypy/translator/stm/test/targetdemo.py
--- a/pypy/translator/stm/test/targetdemo.py
+++ b/pypy/translator/stm/test/targetdemo.py
@@ -14,7 +14,6 @@
     LENGTH      = 5000
     USE_MEMORY  = False
     anchor      = Node(-1)
-    lock        = ll_thread.allocate_ll_lock()
 glob = Global()
 
 class Arg:
@@ -67,7 +66,8 @@
     rstm.descriptor_init()
     try:
         debug_print("thread starting...")
-        arg = Arg()
+        arg = glob._arg
+        ll_thread.release_NOAUTO(glob.lock)
         arg.foobar = 41
         i = 0
         while i < glob.LENGTH:
@@ -92,8 +92,12 @@
             if len(argv) > 3:
                 glob.USE_MEMORY = bool(int(argv[3]))
     glob.done = 0
+    glob.lock = ll_thread.allocate_ll_lock()
+    ll_thread.acquire_NOAUTO(glob.lock, 1)
     for i in range(glob.NUM_THREADS):
+        glob._arg = Arg()
         ll_thread.start_new_thread(run_me, ())
+        ll_thread.acquire_NOAUTO(glob.lock, 1)
     print "sleeping..."
     while glob.done < glob.NUM_THREADS:    # poor man's lock
         time.sleep(1)


More information about the pypy-commit mailing list