[pypy-commit] pypy stmgc-c7: turn inevitable in commit_if_not_atomic

Remi Meier noreply at buildbot.pypy.org
Fri Mar 14 14:40:00 CET 2014


Author: Remi Meier
Branch: stmgc-c7
Changeset: r69952:135462a4e323
Date: 2014-03-14 14:40 +0100
http://bitbucket.org/pypy/pypy/changeset/135462a4e323/

Log:	turn inevitable in commit_if_not_atomic

diff --git a/rpython/translator/stm/src_stm/stmgcintf.h b/rpython/translator/stm/src_stm/stmgcintf.h
--- a/rpython/translator/stm/src_stm/stmgcintf.h
+++ b/rpython/translator/stm/src_stm/stmgcintf.h
@@ -16,11 +16,14 @@
 void pypy_stm_setup_prebuilt(void);   /* generated into stm_prebuilt.c */
 
 static inline void pypy_stm_commit_if_not_atomic(void) {
+    int e = errno;
     if (pypy_stm_ready_atomic == 1) {
-        int e = errno;
         stm_commit_transaction();
-        errno = e;
     }
+    else {
+        _stm_become_inevitable("commit_if_not_atomic in atomic");
+    }
+    errno = e;
 }
 static inline void pypy_stm_start_inevitable_if_not_atomic(void) {
     if (pypy_stm_ready_atomic == 1) {


More information about the pypy-commit mailing list