Author: Armin Rigo <[email protected]>
Branch:
Changeset: r524:782ebd6afc03
Date: 2013-09-07 18:48 +0200
http://bitbucket.org/pypy/stmgc/changeset/782ebd6afc03/
Log: Ignore callbacks if we're outside a transaction or in an inevitable
transaction (which cannot abort)
diff --git a/c4/extra.c b/c4/extra.c
--- a/c4/extra.c
+++ b/c4/extra.c
@@ -25,6 +25,9 @@
void stm_call_on_abort(void *key, void callback(void *))
{
struct tx_descriptor *d = thread_descriptor;
+ if (d == NULL || d->active != 1)
+ return; /* ignore callbacks if we're outside a transaction or
+ in an inevitable transaction (which cannot abort) */
if (callback == NULL) {
/* ignore the return value: unregistered keys can be
"deleted" again */
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit