[pypy-commit] pypy stm-gc: Better _freeze_, to make sure everything is clear during translation.

arigo noreply at buildbot.pypy.org
Fri Apr 20 19:35:34 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54594:fc2c0855b755
Date: 2012-04-20 19:35 +0200
http://bitbucket.org/pypy/pypy/changeset/fc2c0855b755/

Log:	Better _freeze_, to make sure everything is clear during
	translation.

diff --git a/pypy/module/transaction/fifo.py b/pypy/module/transaction/fifo.py
--- a/pypy/module/transaction/fifo.py
+++ b/pypy/module/transaction/fifo.py
@@ -4,6 +4,8 @@
         self.first = None
         self.last = None
 
+    clear = __init__
+
     def append(self, newitem):
         newitem.next = None
         if self.last is None:
diff --git a/pypy/module/transaction/interp_transaction.py b/pypy/module/transaction/interp_transaction.py
--- a/pypy/module/transaction/interp_transaction.py
+++ b/pypy/module/transaction/interp_transaction.py
@@ -28,18 +28,21 @@
         self.transactionalstate = None
         #
         self.w_error = None
+        self.threadobjs = {}      # empty during translation
+        self.threadnums = {}      # empty during translation
+        self.epolls = {}
+        self.pending = Fifo()
+        self._freeze_()
+
+    def _freeze_(self):
         self.ll_lock = threadintf.null_ll_lock
         self.ll_no_tasks_pending_lock = threadintf.null_ll_lock
         self.ll_unfinished_lock = threadintf.null_ll_lock
         self.ll_not_ready_to_start_lock = threadintf.null_ll_lock
-        self.threadobjs = {}      # empty during translation
-        self.threadnums = {}      # empty during translation
-        self.epolls = {}
-        self.pending = Fifo()
-
-    def _freeze_(self):
         self.threadobjs.clear()
         self.threadnums.clear()
+        self.epolls.clear()
+        self.pending.clear()
         return False
 
     def startup(self, space, w_module):


More information about the pypy-commit mailing list