Merge pull request #444 from knocte/xbuild_improvements
[mono.git] / libgc / pthread_stop_world.c
index 3819693c45cea458812c159cb808312eeeec7e96..e6ac64b62a8ee24f5a94a1e3040f9e6ae4d6197b 100644 (file)
@@ -290,6 +290,10 @@ static void pthread_push_all_stacks()
                (unsigned long) lo, (unsigned long) hi);
         #endif
        if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
+       if (p->altstack && lo >= p->altstack && lo <= p->altstack + p->altstack_size)
+               hi = p->altstack + p->altstack_size;
+       /* FIXME: Need to scan the normal stack too, but how ? */
+
 #       ifdef STACK_GROWS_UP
          /* We got them backwards! */
           GC_push_all_stack(hi, lo);
@@ -680,10 +684,14 @@ static void pthread_start_world()
       GC_printf0("World started\n");
     #endif
 #else /* NACL */
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_PRE_START_WORLD);
 #   if DEBUG_THREADS
     GC_printf0("World starting\n");
 #   endif
     nacl_park_threads_now = 0;
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_POST_START_WORLD);
 #endif /* NACL */
 }