Author: Armin Rigo <[email protected]>
Branch: release-2.0.x
Changeset: r64202:4aa84f3d3965
Date: 2013-05-15 21:16 +0200
http://bitbucket.org/pypy/pypy/changeset/4aa84f3d3965/

Log:    Attempt to fix stacklet+thread+asmgcc+callbacks: the ordering was
        wrong, causing self.belongs_to_current_thread to resolve too early
        as the constant "lambda:True".

diff --git a/rpython/memory/gctransform/asmgcroot.py 
b/rpython/memory/gctransform/asmgcroot.py
--- a/rpython/memory/gctransform/asmgcroot.py
+++ b/rpython/memory/gctransform/asmgcroot.py
@@ -331,6 +331,11 @@
                                            [annmodel.SomeInteger(),
                                             annmodel.SomeAddress()],
                                            annmodel.s_None)
+        #
+        # check that the order of the need_*() is correct for us: if we
+        # need both threads and stacklets, need_thread_support() must be
+        # called first, to initialize self.belongs_to_current_thread.
+        assert not hasattr(self, 'gc_detach_callback_pieces_ptr')
 
     def walk_stack_roots(self, collect_stack_root):
         gcdata = self.gcdata
diff --git a/rpython/memory/gctransform/framework.py 
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -236,9 +236,10 @@
         # thread support
         if translator.config.translation.continuation:
             root_walker.stacklet_support = True
-            root_walker.need_stacklet_support(self, getfn)
         if translator.config.translation.thread:
             root_walker.need_thread_support(self, getfn)
+        if root_walker.stacklet_support:
+            root_walker.need_stacklet_support(self, getfn)
 
         self.layoutbuilder.encode_type_shapes_now()
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to