Merged cleanup -> gc7-branch
authorStefan Ring <stefan@complang.tuwien.ac.at>
Sun, 11 May 2008 10:21:01 +0000 (12:21 +0200)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Sun, 11 May 2008 10:21:01 +0000 (12:21 +0200)
--HG--
branch : gc7-branch

1  2 
src/mm/boehm-gc/pthread_stop_world.c
src/threads/posix/thread-posix.c

index ce5d869a2cc2be7dcd86b20ac2dffb8f03f2d3e1,25282402efea2a07b837b411ac43b56eec3a338f..546dc0cc15f9580fb04ee4969a59d532f9efd5a2
@@@ -115,32 -129,32 +115,28 @@@ sem_t GC_suspend_ack_sem
    sem_t GC_restart_ack_sem;
  #endif
  
 -void GC_suspend_handler_inner(ptr_t sig_arg);
 +void GC_suspend_handler_inner(ptr_t sig_arg, void *context);
  /* int cacao_suspendhandler(void *); */
  
 -#if defined(IA64) || defined(HP_PA)
 -extern void GC_with_callee_saves_pushed();
 -
 -void GC_suspend_handler(int sig)
 +#if defined(IA64) || defined(HP_PA) || defined(M68K)
 +void GC_suspend_handler(int sig, siginfo_t *info, void *context)
  {
--   int old_errno = errno;
--   GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig);
--   errno = old_errno;
++  int old_errno = errno;
++  GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig);
++  errno = old_errno;
  }
 - 
  #else
 -/* We believe that in all other cases the full context is already     */
 -/* in the signal handler frame.                                               */
 -void GC_suspend_handler(int sig, siginfo_t *info, void *uctx)
 +/* We believe that in all other cases the full context is already     */
 +/* in the signal handler frame.                                               */
 +void GC_suspend_handler(int sig, siginfo_t *info, void *context)
  {
--   int old_errno = errno;
- /*    if (cacao_suspendhandler(uctx)) */
- /*      return; */
--
-    GC_suspend_handler_inner((ptr_t)(word)sig, context);
 -   GC_suspend_handler_inner((ptr_t)(word)sig);
--   errno = old_errno;
++  int old_errno = errno;
++  GC_suspend_handler_inner((ptr_t)(word)sig, context);
++  errno = old_errno;
  }
  #endif
 - 
 -void GC_suspend_handler_inner(ptr_t sig_arg)
 +
 +void GC_suspend_handler_inner(ptr_t sig_arg, void *context)
  {
      int sig = (int)(word)sig_arg;
      int dummy;
@@@ -374,13 -387,10 +370,11 @@@ void GC_stop_world(
      int n_live_threads;
      int code;
  
 -    #if DEBUG_THREADS
 -    GC_printf1("Stopping the world from 0x%lx\n", pthread_self());
 -    #endif
 -
 +    GC_ASSERT(I_HOLD_LOCK());
 +#   if DEBUG_THREADS
 +      GC_printf("Stopping the world from 0x%x\n", (unsigned)pthread_self());
 +#   endif
-     lock_stopworld(1);
 +       
      /* Make sure all free list construction has stopped before we start. */
      /* No new construction can start, since free list construction is */
      /* required to acquire and release the GC lock before it starts,  */
@@@ -486,21 -491,18 +480,18 @@@ void GC_start_world(
          }
        }
      }
 -#ifdef GC_NETBSD_THREADS_WORKAROUND
 -    for (i = 0; i < n_live_threads; i++)
 +#   ifdef GC_NETBSD_THREADS_WORKAROUND
 +      for (i = 0; i < n_live_threads; i++)
        while (0 != (code = sem_wait(&GC_restart_ack_sem)))
            if (errno != EINTR) {
 -              GC_err_printf1("sem_wait() returned %ld\n", (unsigned long)code);
 +              GC_err_printf1("sem_wait() returned %ld\n",
 +                             (unsigned long)code);
                ABORT("sem_wait() for restart handler failed");
            }
 -#endif
 -
 -    #if DEBUG_THREADS
 -      GC_printf0("World started\n");
 -    #endif
 +#    endif
-       unlock_stopworld();
 +#    if DEBUG_THREADS
 +      GC_printf("World started\n");
 +#    endif
  }
  
  void GC_stop_init() {
Simple merge