[pypy-commit] pypy stmgc-c7: fix for restoring atomic state in start_if_not_atomic

Raemi noreply at buildbot.pypy.org
Tue Aug 19 09:32:15 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: stmgc-c7
Changeset: r72899:2315ec757d57
Date: 2014-08-19 09:31 +0200
http://bitbucket.org/pypy/pypy/changeset/2315ec757d57/

Log:	fix for restoring atomic state in start_if_not_atomic

diff --git a/rpython/translator/stm/src_stm/stmgcintf.c b/rpython/translator/stm/src_stm/stmgcintf.c
--- a/rpython/translator/stm/src_stm/stmgcintf.c
+++ b/rpython/translator/stm/src_stm/stmgcintf.c
@@ -159,7 +159,7 @@
     pypy_stm_nursery_low_fill_mark = _stm_nursery_start + limit;
 }
 
-static long _pypy_stm_start_transaction(void)
+long _pypy_stm_start_transaction(void)
 {
     pypy_stm_nursery_low_fill_mark = 1;  /* will be set to a correct value below */
     long counter = stm_start_transaction(&stm_thread_local);
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
@@ -26,6 +26,7 @@
 
 void _pypy_stm_initialize_nursery_low_fill_mark(long v_counter);
 void _pypy_stm_inev_state(void);
+long _pypy_stm_start_transaction(void);
 
 void _pypy_stm_become_inevitable(const char *);
 void pypy_stm_become_globally_unique_transaction(void);
@@ -56,9 +57,7 @@
 static inline void pypy_stm_start_if_not_atomic(void) {
     if (pypy_stm_ready_atomic == 1) {
         int e = errno;
-        stm_start_transaction(&stm_thread_local);
-        _pypy_stm_initialize_nursery_low_fill_mark(0);
-        _pypy_stm_inev_state();
+        _pypy_stm_start_transaction();
         errno = e;
     }
 }


More information about the pypy-commit mailing list