use siginfo
authorstefan <none@none>
Fri, 30 Apr 2004 11:53:22 +0000 (11:53 +0000)
committerstefan <none@none>
Fri, 30 Apr 2004 11:53:22 +0000 (11:53 +0000)
mm/boehm-gc/pthread_stop_world.c
src/boehm-gc/pthread_stop_world.c
src/threads/native/threads.c
threads/nativethread.c

index cfd0507a4d84ad4d9cdeae663c5c870b9a32a2c1..7318a061f4f0fce4c3d05f7e79c27125605cc87e 100644 (file)
@@ -75,9 +75,8 @@ sem_t GC_suspend_ack_sem;
 
 int cacao_suspendhandler(void *);
 
-void GC_suspend_handler(int sig)
+void GC_suspend_handler(int sig, siginfo_t *info, void *uctx)
 {
-       void **_p = (void *) &sig;
     int dummy;
     pthread_t my_thread = pthread_self();
     GC_thread me;
@@ -92,7 +91,7 @@ void GC_suspend_handler(int sig)
 
     if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
 
-       if (cacao_suspendhandler(++_p))
+       if (cacao_suspendhandler(uctx))
                return;
 
 #if DEBUG_THREADS
@@ -418,7 +417,7 @@ void GC_stop_init() {
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
 
-    act.sa_flags = SA_RESTART;
+    act.sa_flags = SA_RESTART | SA_SIGINFO;
     if (sigfillset(&act.sa_mask) != 0) {
        ABORT("sigfillset() failed");
     }
@@ -466,7 +465,6 @@ int GC_signum2()
 {
     return SIG_THR_RESTART;
 }
-
 /* cacao END */
 
 #endif
index cfd0507a4d84ad4d9cdeae663c5c870b9a32a2c1..7318a061f4f0fce4c3d05f7e79c27125605cc87e 100644 (file)
@@ -75,9 +75,8 @@ sem_t GC_suspend_ack_sem;
 
 int cacao_suspendhandler(void *);
 
-void GC_suspend_handler(int sig)
+void GC_suspend_handler(int sig, siginfo_t *info, void *uctx)
 {
-       void **_p = (void *) &sig;
     int dummy;
     pthread_t my_thread = pthread_self();
     GC_thread me;
@@ -92,7 +91,7 @@ void GC_suspend_handler(int sig)
 
     if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
 
-       if (cacao_suspendhandler(++_p))
+       if (cacao_suspendhandler(uctx))
                return;
 
 #if DEBUG_THREADS
@@ -418,7 +417,7 @@ void GC_stop_init() {
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
 
-    act.sa_flags = SA_RESTART;
+    act.sa_flags = SA_RESTART | SA_SIGINFO;
     if (sigfillset(&act.sa_mask) != 0) {
        ABORT("sigfillset() failed");
     }
@@ -466,7 +465,6 @@ int GC_signum2()
 {
     return SIG_THR_RESTART;
 }
-
 /* cacao END */
 
 #endif
index 033bbf5a1e6d9d25725f241a340ea2852f95013c..39d88bc54da450b366628f69d89eb0d9b7980363 100644 (file)
@@ -197,15 +197,15 @@ void cast_startworld()
        unlock_stopworld();
 }
 
-static void sigsuspend_handler(struct sigcontext *ctx)
+static void sigsuspend_handler(ucontext_t *ctx)
 {
        int sig;
        sigset_t sigs;
        void *critical;
        
 #ifdef __I386__
-       if ((critical = thread_checkcritical((void*) ctx->eip)) != NULL)
-               ctx->eip = (long) critical;
+       if ((critical = thread_checkcritical((void*) ctx->uc_mcontext.gregs[REG_EIP])) != NULL)
+               ctx->uc_mcontext.gregs[REG_EIP] = (long) critical;
 #endif
 
        sem_post(&suspend_ack);
@@ -216,7 +216,7 @@ static void sigsuspend_handler(struct sigcontext *ctx)
        sigsuspend(&sigs);
 }
 
-int cacao_suspendhandler(struct sigcontext *ctx)
+int cacao_suspendhandler(ucontext_t *ctx)
 {
        if (stopworldwhere != 2)
                return 0;
index 033bbf5a1e6d9d25725f241a340ea2852f95013c..39d88bc54da450b366628f69d89eb0d9b7980363 100644 (file)
@@ -197,15 +197,15 @@ void cast_startworld()
        unlock_stopworld();
 }
 
-static void sigsuspend_handler(struct sigcontext *ctx)
+static void sigsuspend_handler(ucontext_t *ctx)
 {
        int sig;
        sigset_t sigs;
        void *critical;
        
 #ifdef __I386__
-       if ((critical = thread_checkcritical((void*) ctx->eip)) != NULL)
-               ctx->eip = (long) critical;
+       if ((critical = thread_checkcritical((void*) ctx->uc_mcontext.gregs[REG_EIP])) != NULL)
+               ctx->uc_mcontext.gregs[REG_EIP] = (long) critical;
 #endif
 
        sem_post(&suspend_ack);
@@ -216,7 +216,7 @@ static void sigsuspend_handler(struct sigcontext *ctx)
        sigsuspend(&sigs);
 }
 
-int cacao_suspendhandler(struct sigcontext *ctx)
+int cacao_suspendhandler(ucontext_t *ctx)
 {
        if (stopworldwhere != 2)
                return 0;