[pypy-commit] stmgc rewind_setjmp: Re-enable and fix forksupport.c

arigo noreply at buildbot.pypy.org
Sat Aug 9 18:08:02 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: rewind_setjmp
Changeset: r1284:37c19d87b177
Date: 2014-08-09 18:01 +0200
http://bitbucket.org/pypy/stmgc/changeset/37c19d87b177/

Log:	Re-enable and fix forksupport.c

diff --git a/c7/stm/forksupport.c b/c7/stm/forksupport.c
--- a/c7/stm/forksupport.c
+++ b/c7/stm/forksupport.c
@@ -3,9 +3,6 @@
 #endif
 
 
-
-#if 0
-
 /* XXX this is currently not doing copy-on-write, but simply forces a
    copy of all pages as soon as fork() is called. */
 
@@ -179,14 +176,15 @@
 static void fork_abort_thread(long i)
 {
     struct stm_priv_segment_info_s *pr = get_priv_segment(i);
+    stm_thread_local_t *tl = pr->pub.running_thread;
     dprintf(("forksupport_child: abort in seg%ld\n", i));
-    assert(pr->pub.running_thread->associated_segment_num == i);
+    assert(tl->associated_segment_num == i);
     assert(pr->transaction_state == TS_REGULAR);
     set_gs_register(get_segment_base(i));
 
-    stm_jmpbuf_t jmpbuf;
-    if (__builtin_setjmp(jmpbuf) == 0) {
-        pr->pub.jmpbuf_ptr = &jmpbuf;
+    rewind_jmp_buf rjbuf;
+    stm_rewind_jmp_enterframe(tl, &rjbuf);
+    if (rewind_jmp_setjmp(&tl->rjthread) == 0) {
 #ifndef NDEBUG
         pr->running_pthread = pthread_self();
 #endif
@@ -194,6 +192,7 @@
             pr->shadowstack_at_start_of_transaction);
         stm_abort_transaction();
     }
+    stm_rewind_jmp_leaveframe(tl, &rjbuf);
 }
 
 static void forksupport_child(void)
@@ -302,7 +301,3 @@
         fork_support_ready = true;
     }
 }
-#endif
-static void setup_forksupport(void) {
-    if (0) _page_do_reshare(0, 0);
-}


More information about the pypy-commit mailing list