equal
deleted
inserted
replaced
2754 |
2754 |
2755 // attempt to switch the state, we assume we had a SUSPEND_REQUEST |
2755 // attempt to switch the state, we assume we had a SUSPEND_REQUEST |
2756 os::SuspendResume::State state = osthread->sr.suspended(); |
2756 os::SuspendResume::State state = osthread->sr.suspended(); |
2757 if (state == os::SuspendResume::SR_SUSPENDED) { |
2757 if (state == os::SuspendResume::SR_SUSPENDED) { |
2758 sigset_t suspend_set; // signals for sigsuspend() |
2758 sigset_t suspend_set; // signals for sigsuspend() |
2759 |
2759 sigemptyset(&suspend_set); |
2760 // get current set of blocked signals and unblock resume signal |
2760 // get current set of blocked signals and unblock resume signal |
2761 pthread_sigmask(SIG_BLOCK, NULL, &suspend_set); |
2761 pthread_sigmask(SIG_BLOCK, NULL, &suspend_set); |
2762 sigdelset(&suspend_set, SR_signum); |
2762 sigdelset(&suspend_set, SR_signum); |
2763 |
2763 |
2764 // wait here until we are resumed |
2764 // wait here until we are resumed |
3040 actp->sa_handler = SIG_DFL; |
3040 actp->sa_handler = SIG_DFL; |
3041 } |
3041 } |
3042 |
3042 |
3043 // try to honor the signal mask |
3043 // try to honor the signal mask |
3044 sigset_t oset; |
3044 sigset_t oset; |
|
3045 sigemptyset(&oset); |
3045 pthread_sigmask(SIG_SETMASK, &(actp->sa_mask), &oset); |
3046 pthread_sigmask(SIG_SETMASK, &(actp->sa_mask), &oset); |
3046 |
3047 |
3047 // call into the chained handler |
3048 // call into the chained handler |
3048 if (siginfo_flag_set) { |
3049 if (siginfo_flag_set) { |
3049 (*sa)(sig, siginfo, context); |
3050 (*sa)(sig, siginfo, context); |
3050 } else { |
3051 } else { |
3051 (*hand)(sig); |
3052 (*hand)(sig); |
3052 } |
3053 } |
3053 |
3054 |
3054 // restore the signal mask |
3055 // restore the signal mask |
3055 pthread_sigmask(SIG_SETMASK, &oset, 0); |
3056 pthread_sigmask(SIG_SETMASK, &oset, NULL); |
3056 } |
3057 } |
3057 // Tell jvm's signal handler the signal is taken care of. |
3058 // Tell jvm's signal handler the signal is taken care of. |
3058 return true; |
3059 return true; |
3059 } |
3060 } |
3060 |
3061 |