Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r60026:e4428d6488d8
Date: 2013-01-13 13:21 +0100
http://bitbucket.org/pypy/pypy/changeset/e4428d6488d8/

Log:    Pushing and popping roots around gc_thread_run() and gc_thread_die()
        doesn't make sense. Fixed by asserting we don't actually have to
        push any. Fix a test. PyPy translation was fixed by 509f13a420c6.

diff --git a/pypy/module/thread/test/test_gil.py 
b/pypy/module/thread/test/test_gil.py
--- a/pypy/module/thread/test/test_gil.py
+++ b/pypy/module/thread/test/test_gil.py
@@ -61,8 +61,9 @@
         def bootstrap():
             try:
                 runme()
-            finally:
-                thread.gc_thread_die()
+            except Exception, e:
+                assert 0
+            thread.gc_thread_die()
         def f():
             state.data = []
             state.datalen1 = 0
diff --git a/pypy/rpython/memory/gctransform/framework.py 
b/pypy/rpython/memory/gctransform/framework.py
--- a/pypy/rpython/memory/gctransform/framework.py
+++ b/pypy/rpython/memory/gctransform/framework.py
@@ -979,6 +979,7 @@
         assert self.translator.config.translation.thread
         if hasattr(self.root_walker, 'thread_run_ptr'):
             livevars = self.push_roots(hop)
+            assert not livevars, "live GC var around %s!" % (hop.spaceop,)
             hop.genop("direct_call", [self.root_walker.thread_run_ptr])
             self.pop_roots(hop, livevars)
 
@@ -993,6 +994,7 @@
         assert self.translator.config.translation.thread
         if hasattr(self.root_walker, 'thread_die_ptr'):
             livevars = self.push_roots(hop)
+            assert not livevars, "live GC var around %s!" % (hop.spaceop,)
             hop.genop("direct_call", [self.root_walker.thread_die_ptr])
             self.pop_roots(hop, livevars)
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to