< prev index next >
src/hotspot/os/posix/os_posix.cpp
Print this page
*** 1642,1651 ****
--- 1642,1669 ----
if ((status = pthread_mutexattr_settype(_mutexAttr, PTHREAD_MUTEX_NORMAL)) != 0) {
fatal("pthread_mutexattr_settype: %s", os::strerror(status));
}
}
+ #ifndef SOLARIS
+ sigset_t sigs;
+ struct sigaction sigact[NSIG];
+
+ struct sigaction* os::Posix::get_preinstalled_handler(int sig) {
+ if (sigismember(&sigs, sig)) {
+ return &sigact[sig];
+ }
+ return NULL;
+ }
+
+ void os::Posix::save_preinstalled_handler(int sig, struct sigaction& oldAct) {
+ assert(sig > 0 && sig < NSIG, "vm signal out of expected range");
+ sigact[sig] = oldAct;
+ sigaddset(&sigs, sig);
+ }
+ #endif
+
// Not all POSIX types and API's are available on all notionally "posix"
// platforms. If we have build-time support then we will check for actual
// runtime support via dlopen/dlsym lookup. This allows for running on an
// older OS version compared to the build platform. But if there is no
// build time support then there cannot be any runtime support as we do not
*** 1752,1761 ****
--- 1770,1780 ----
(_clock_gettime != NULL ? "" : " not"));
log_info(os)("Use of pthread_condattr_setclock is%s supported",
(_pthread_condattr_setclock != NULL ? "" : " not"));
log_info(os)("Relative timed-wait using pthread_cond_timedwait is associated with %s",
_use_clock_monotonic_condattr ? "CLOCK_MONOTONIC" : "the default clock");
+ sigemptyset(&sigs);
#endif // !SOLARIS
}
#else // !SUPPORTS_CLOCK_MONOTONIC
*** 1766,1775 ****
--- 1785,1795 ----
void os::Posix::init_2(void) {
#ifndef SOLARIS
log_info(os)("Use of CLOCK_MONOTONIC is not supported");
log_info(os)("Use of pthread_condattr_setclock is not supported");
log_info(os)("Relative timed-wait using pthread_cond_timedwait is associated with the default clock");
+ sigemptyset(&sigs);
#endif // !SOLARIS
}
#endif // SUPPORTS_CLOCK_MONOTONIC
< prev index next >