[pypy-svn] r33256 - pypy/dist/pypy/objspace/cclp/constraint

auc at codespeak.net auc at codespeak.net
Fri Oct 13 16:25:33 CEST 2006


Author: auc
Date: Fri Oct 13 16:25:31 2006
New Revision: 33256

Modified:
   pypy/dist/pypy/objspace/cclp/constraint/distributor.py
Log:
slightly more correct


Modified: pypy/dist/pypy/objspace/cclp/constraint/distributor.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/constraint/distributor.py	(original)
+++ pypy/dist/pypy/objspace/cclp/constraint/distributor.py	Fri Oct 13 16:25:31 2006
@@ -7,7 +7,7 @@
 from pypy.objspace.std.intobject import W_IntObject
 from pypy.objspace.std.stringobject import W_StringObject
 
-from pypy.objspace.cclp.types import W_AbstractDistributor
+from pypy.objspace.cclp.types import W_AbstractDistributor, ConsistencyError
 from pypy.objspace.cclp.misc import w, get_current_cspace
 
 def distribute(space, w_strategy):
@@ -23,9 +23,18 @@
 
     cspace.distributor = dist
     # constraint distributor thread main loop
-    while dist.distributable():
+    cspace.wait_stable()
+    if not dist.distributable():
+        return
+    while 1:
         choice = cspace.choose(dist.fanout())
-        dist.w_distribute(choice)
+        if dist.distributable():
+            dist.w_distribute(choice)
+            # propagators laucnhed
+        else:
+            if cspace._failed:
+                raise ConsistencyError
+            break
 app_distribute = interp2app(distribute)
 
 



More information about the Pypy-commit mailing list