diff options
author | Hans Boehm <Hans_Boehm@hp.com> | 2005-02-09 21:33:02 +0000 |
---|---|---|
committer | Hans Boehm <hboehm@gcc.gnu.org> | 2005-02-09 21:33:02 +0000 |
commit | 328d1d4c1c902bfa35bfdb69d7b22afca3a68e14 (patch) | |
tree | 740a513131a2bfd49e69843a563d9ce978424f93 /boehm-gc/pthread_stop_world.c | |
parent | dab80c81c6b7fc84a08f1d1d5745c6861c7082c9 (diff) | |
download | gcc-328d1d4c1c902bfa35bfdb69d7b22afca3a68e14.zip gcc-328d1d4c1c902bfa35bfdb69d7b22afca3a68e14.tar.gz gcc-328d1d4c1c902bfa35bfdb69d7b22afca3a68e14.tar.bz2 |
allchblk.c (GC_allochblk_nth): Dont overlook available space if GC disabled...
* allchblk.c (GC_allochblk_nth): Dont overlook available space if
GC disabled, correctly convert GC_finalizer_mem_freed to byte,
total_size to words.
* dyn_load.c (win32 GC_register_dynamic_libraries): Consider only
MEM_IMAGE regions.
* mach_dep.c (GC_with_callee_saves_pushed): separate into new function,
and indent appropriately.
* mark_rts.c (GC_approx_sp): Access stack.
* pthread_stop_world.c: (GC_suspend_handler): Explicitly push
callee-saves registers when appropriate.
(GC_stop_world): Handle EINTR from sem_wait (sync with Mono GC).
From-SVN: r94776
Diffstat (limited to 'boehm-gc/pthread_stop_world.c')
-rw-r--r-- | boehm-gc/pthread_stop_world.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c index 832c49c..b5e7fae 100644 --- a/boehm-gc/pthread_stop_world.c +++ b/boehm-gc/pthread_stop_world.c @@ -101,8 +101,28 @@ word GC_stop_count; /* Incremented at the beginning of GC_stop_world. */ sem_t GC_suspend_ack_sem; +void GC_suspend_handler_inner(ptr_t sig_arg); + +#if defined(IA64) || defined(HP_PA) +extern void GC_with_callee_saves_pushed(); + void GC_suspend_handler(int sig) { + GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig); +} + +#else +/* We believe that in all other cases the full context is already */ +/* in the signal handler frame. */ +void GC_suspend_handler(int sig) +{ + GC_suspend_handler_inner((ptr_t)(word)sig); +} +#endif + +void GC_suspend_handler_inner(ptr_t sig_arg) +{ + int sig = (int)(word)sig_arg; int dummy; pthread_t my_thread = pthread_self(); GC_thread me; @@ -369,9 +389,11 @@ void GC_stop_world() } } for (i = 0; i < n_live_threads; i++) { - if (0 != (code = sem_wait(&GC_suspend_ack_sem))) { + while (0 != (code = sem_wait(&GC_suspend_ack_sem))) { + if (errno != EINTR) { GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code); ABORT("sem_wait for handler failed"); + } } } # ifdef PARALLEL_MARK |