X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=boehm-gc%2Fpthread_stop_world.c;h=b5e7faed5abb761d7ef49f66116c5c81f2599f4c;hb=671ec72e2703ac9c72c204ba6c4939eeea83d370;hp=832c49ca81e53d6173deba6dd190fd0361f0d694;hpb=8f935875042f0745744dd4e91bbdedf032de96bb;p=pf3gnuchains%2Fgcc-fork.git diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c index 832c49ca81e..b5e7faed5ab 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