Commits

Armin Rigo committed e4428d6

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.

Comments (0)

Files changed (2)

pypy/module/thread/test/test_gil.py

         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

pypy/rpython/memory/gctransform/framework.py

         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)
 
         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)