Author: Remi Meier <[email protected]>
Branch: 
Changeset: r1634:b57570d33a43
Date: 2015-02-18 11:43 +0100
http://bitbucket.org/pypy/stmgc/changeset/b57570d33a43/

Log:    reduce diff between c7 and c8 a bit

diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -774,9 +774,15 @@
 
 void stm_start_inevitable_transaction(stm_thread_local_t *tl)
 {
-    s_mutex_lock();
-    _stm_start_transaction(tl);
-    _stm_become_inevitable("stm_start_inevitable_transaction");
+    /* used to be more efficient, starting directly an inevitable transaction,
+       but there is no real point any more, I believe */
+    rewind_jmp_buf rjbuf;
+    stm_rewind_jmp_enterframe(tl, &rjbuf);
+
+    stm_start_transaction(tl);
+    stm_become_inevitable(tl, "start_inevitable_transaction");
+
+    stm_rewind_jmp_leaveframe(tl, &rjbuf);
 }
 
 #ifdef STM_NO_AUTOMATIC_SETJMP
@@ -858,15 +864,18 @@
     bool was_inev = STM_PSEGMENT->transaction_state == TS_INEVITABLE;
     _validate_and_add_to_commit_log();
 
-    invoke_and_clear_user_callbacks(0);   /* for commit */
+
 
     /* XXX do we still need a s_mutex_lock() section here? */
     s_mutex_lock();
+
     enter_safe_point_if_requested();
     assert(STM_SEGMENT->nursery_end == NURSERY_END);
 
     stm_rewind_jmp_forget(STM_SEGMENT->running_thread);
 
+    invoke_and_clear_user_callbacks(0);   /* for commit */
+
     if (globally_unique_transaction && was_inev) {
         committed_globally_unique_transaction();
     }
diff --git a/c8/stm/gcpage.c b/c8/stm/gcpage.c
--- a/c8/stm/gcpage.c
+++ b/c8/stm/gcpage.c
@@ -402,6 +402,7 @@
 
     /* also visit all objs in the rewind-shadowstack */
     long i;
+    assert(get_priv_segment(0)->transaction_state == TS_NONE);
     for (i = 1; i < NB_SEGMENTS; i++) {
         if (get_priv_segment(i)->transaction_state != TS_NONE) {
             mark_visit_possibly_new_object(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to