Commits

Armin Rigo  committed 0ba9edd

import stmgc/6718bfcdc402

  • Participants
  • Parent commits a7fa558
  • Branches stmgc-c7

Comments (0)

Files changed (3)

File rpython/translator/stm/src_stm/revision

-d912ca6f0d53
+6718bfcdc402

File rpython/translator/stm/src_stm/stm/extra.c

 #endif
 
 
-void stm_call_on_abort(void *key, void callback(void *))
+void stm_call_on_abort(stm_thread_local_t *tl,
+                       void *key, void callback(void *))
 {
-    assert(_running_transaction());
+    if (!_stm_in_transaction(tl)) {
+        /* check that the current thread-local is really running a
+           transaction, and do nothing otherwise. */
+        return;
+    }
 
     if (STM_PSEGMENT->transaction_state == TS_INEVITABLE) {
         /* ignore callbacks if we're in an inevitable transaction

File rpython/translator/stm/src_stm/stmgc.h

    can only register one callback per key.  You can call
    'stm_call_on_abort(key, NULL)' to cancel an existing callback.
    Note: 'key' must be aligned to a multiple of 8 bytes. */
-void stm_call_on_abort(void *key, void callback(void *));
+void stm_call_on_abort(stm_thread_local_t *, void *key, void callback(void *));
 
 
 /* ==================== END ==================== */