path: root/pthread_stop_world.c
diff options
authorivmai <ivmai>2009-09-19 11:28:28 +0200
committerIvan Maidanski <>2011-07-26 19:06:47 +0200
commitd1d1fc8d9e51ffa49da97f99ad6158c090fb7e80 (patch)
tree8abfd8aadc9b834f34c25c779e7f7825edfd285a /pthread_stop_world.c
parente3bb4782167e908af00a7c963373f4d2304fbe33 (diff)
2009-09-19 Ivan Maidanski <>
(ivmai130a.diff, ivmai130b.diff - superseding diff44, diff69) * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New function prototype. * include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the single-threaded case) with an assertion check for the state to be not a "do-blocking" one. * include/private/gc_priv.h (blocking_data): Move the structure definition from pthread_support.c; change "fn" return type to void pointer. * include/private/gc_priv.h (GC_activation_frame_s): New structure type. * include/private/gc_priv.h (GC_push_all_stack_frames): New function declaration (only if THREADS). * include/private/gc_priv.h (GC_world_stopped): Don't declare unless THREADS. * include/private/gc_priv.h (GC_blocked_sp, GC_activation_frame_s): New declaration (only if not THREADS). * include/private/gc_priv.h (GC_push_all_register_frames): New function declaration (only for IA-64). * include/private/gc_priv.h (NURSERY, GC_push_proc): Remove obsolete (unused) symbols. * include/private/gc_priv.h (GC_push_all_stack_partially_eager): Remove declaration (since it is static now). * mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c (for code locality) and make STATIC. * mark_rts.c (GC_push_all_register_frames): New function (only for IA-64). * mark_rts.c (GC_push_all_stack_frames): New function (only if THREADS). * mark_rts.c (GC_add_trace_entry): New function prototype (used by GC_push_all_stack_partially_eager(), only if TRACE_BUF). * mark_rts.c (GC_push_all_stack_part_eager_frames): New function. * mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a function body (only for IA-64). * mark_rts.c (GC_push_current_stack): Call GC_push_all_stack_part_eager_frames() instead of GC_push_all_stack_partially_eager(). * mark_rts.c (GC_push_current_stack): Call GC_push_all_register_frames() instead of GC_push_all_eager() for IA-64 backing store. * misc.c (GC_do_blocking_inner): Declare function (if THREADS only). * misc.c (GC_blocked_sp, GC_blocked_register_sp, GC_activation_frame): New global variables (only if not THREADS). * misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API function (only if not THREADS). * misc.c (GC_do_blocking): Move the function from pthread_support.c. * include/private/pthread_support.h (GC_Thread_Rep): Add "activation_frame" field. * pthread_stop_world.c (GC_push_all_stacks): Call GC_push_all_stack_frames() and GC_push_all_register_frames instead of GC_push_all_stack() and/or GC_push_all_eager(); don't check for STACK_GROWS_UP here. * pthread_support.c (GC_do_blocking_inner): Remove "static"; store "fn" result back to "client_data" field. * pthread_support.c (GC_call_with_gc_active): New API function. * win32_threads.c (GC_call_with_gc_active): Ditto. * win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and "activation_frame" fields. * win32_threads.c (GC_new_thread): Add assertion checking for thread_blocked_sp is NULL. * win32_threads.c (GC_do_blocking_inner): New function. * win32_threads.c (GC_stop_world): Don't suspend a thread if its thread_blocked_sp is non-NULL. * win32_threads.c (GC_push_stack_for): Use thread "activation_frame" (if non-NULL); use "thread_blocked_sp" if non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the thread before modifying its last_stack_min; call GC_push_all_stack_frames() instead of GC_push_all_stack(); update the comments.
Diffstat (limited to 'pthread_stop_world.c')
1 files changed, 5 insertions, 13 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 6494080..e50a13e 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -290,24 +290,16 @@ void GC_push_all_stacks(void)
(unsigned)(p -> id), lo, hi);
# endif
if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
- /* We got them backwards! */
- GC_push_all_stack(hi, lo);
-# else
- GC_push_all_stack(lo, hi);
-# endif
+ GC_push_all_stack_frames(lo, hi, p -> activation_frame);
# ifdef IA64
GC_printf("Reg stack for thread 0x%x = [%p,%p)\n",
(unsigned)p -> id, bs_lo, bs_hi);
# endif
- if (THREAD_EQUAL(p -> id, me)) {
- /* FIXME: This may add an unbounded number of entries, */
- /* and hence overflow the mark stack, which is bad. */
- GC_push_all_eager(bs_lo, bs_hi);
- } else {
- GC_push_all_stack(bs_lo, bs_hi);
- }
+ /* FIXME: This (if p->id==me) may add an unbounded number of */
+ /* entries, and hence overflow the mark stack, which is bad. */
+ GC_push_all_register_frames(bs_lo, bs_hi,
+ THREAD_EQUAL(p -> id, me), p -> activation_frame);
# endif