[pypy-commit] pypy stm-gc: Debugging. Should be safe in module/transaction/, but better safe than
arigo
noreply at buildbot.pypy.org
Thu Apr 26 10:44:31 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54754:ddc99cc0bf55
Date: 2012-04-25 16:02 +0200
http://bitbucket.org/pypy/pypy/changeset/ddc99cc0bf55/
Log: Debugging. Should be safe in module/transaction/, but better safe
than horribly confusingly sorry.
diff --git a/pypy/rlib/rstm.py b/pypy/rlib/rstm.py
--- a/pypy/rlib/rstm.py
+++ b/pypy/rlib/rstm.py
@@ -19,6 +19,7 @@
class Transaction(object):
_next_transaction = None
+ _scheduled = False # debugging
retry_counter = 0
def run(self):
@@ -187,6 +188,7 @@
transaction._next_transaction = transaction
#
transaction.retry_counter = retry_counter
+ transaction._scheduled = False
new_transactions = transaction.run()
return _link_new_transactions(new_transactions)
_run_really._dont_inline_ = True
@@ -203,6 +205,11 @@
while n >= 0:
new_transactions[n]._next_transaction = next
next = new_transactions[n]
+ #
+ ll_assert(not next._scheduled,
+ "the same Transaction instance is scheduled more than once")
+ next._scheduled = True
+ #
n -= 1
return next
More information about the pypy-commit
mailing list