[pypy-svn] r64458 - in pypy/trunk/pypy: module/_stackless/test rlib

iko at codespeak.net iko at codespeak.net
Mon Apr 20 16:21:52 CEST 2009


Author: iko
Date: Mon Apr 20 16:21:50 2009
New Revision: 64458

Modified:
   pypy/trunk/pypy/module/_stackless/test/test_interp_coroutine.py
   pypy/trunk/pypy/rlib/rcoroutine.py
Log:
(iko, pedronis, arigo): Fix hanging stackless test



Modified: pypy/trunk/pypy/module/_stackless/test/test_interp_coroutine.py
==============================================================================
--- pypy/trunk/pypy/module/_stackless/test/test_interp_coroutine.py	(original)
+++ pypy/trunk/pypy/module/_stackless/test/test_interp_coroutine.py	Mon Apr 20 16:21:50 2009
@@ -299,6 +299,7 @@
         costate.hello_goodbye = 0
 
         def ep():
+            syncstate.default_costate = costate
             costate.hello_goodbye = 0
             c1 = C(4)
             c1.bind(T())

Modified: pypy/trunk/pypy/rlib/rcoroutine.py
==============================================================================
--- pypy/trunk/pypy/rlib/rcoroutine.py	(original)
+++ pypy/trunk/pypy/rlib/rcoroutine.py	Mon Apr 20 16:21:50 2009
@@ -134,6 +134,10 @@
         else:
             self.things_to_do = False
 
+    def _freeze_(self):
+        self.reset()
+        return False
+
 syncstate = SyncState()
 
 
@@ -281,6 +285,8 @@
             pass # maybe print a warning?
         self.kill()
 
+    __already_postponed = False
+    
     def __del__(self):
         # provide the necessary clean-up
         # note that AppCoroutine has to take care about this
@@ -292,6 +298,11 @@
         # it is necessary to check whether syncstate is None because CPython
         # sets it to None when it cleans up the modules, which will lead to
         # very strange effects
+
+        if not we_are_translated():
+            if self.__already_postponed:
+                return
+            self.__already_postponed = True
         if syncstate is not None:
             syncstate.postpone_deletion(self)
 



More information about the Pypy-commit mailing list