< prev index next >

src/hotspot/os/solaris/os_solaris.cpp

Print this page

        

*** 2038,2049 **** // code platform specific, which it is by its very nature. // a counter for each possible signal value static int Sigexit = 0; static jint *pending_signals = NULL; - static int *preinstalled_sigs = NULL; - static struct sigaction *chainedsigactions = NULL; static Semaphore* sig_sem = NULL; int os::sigexitnum_pd() { assert(Sigexit > 0, "signal memory not yet initialized"); return Sigexit; --- 2038,2047 ----
*** 2059,2075 **** // pending_signals has one int per signal // The additional signal is for SIGEXIT - exit signal to signal_thread pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1), mtInternal); memset(pending_signals, 0, (sizeof(jint) * (Sigexit+1))); ! if (UseSignalChaining) { ! chainedsigactions = (struct sigaction *)malloc(sizeof(struct sigaction) ! * (Maxsignum + 1), mtInternal); ! memset(chainedsigactions, 0, (sizeof(struct sigaction) * (Maxsignum + 1))); ! preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1), mtInternal); ! memset(preinstalled_sigs, 0, (sizeof(int) * (Maxsignum + 1))); ! } ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1), mtInternal); memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1)); } static void jdk_misc_signal_init() { --- 2057,2067 ---- // pending_signals has one int per signal // The additional signal is for SIGEXIT - exit signal to signal_thread pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1), mtInternal); memset(pending_signals, 0, (sizeof(jint) * (Sigexit+1))); ! os::Posix::init_sigs(); ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1), mtInternal); memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1)); } static void jdk_misc_signal_init() {
*** 3603,3613 **** // Retrieve the old signal handler from libjsig actp = (*get_signal_action)(sig); } if (actp == NULL) { // Retrieve the preinstalled signal handler from jvm ! actp = get_preinstalled_handler(sig); } return actp; } --- 3595,3605 ---- // Retrieve the old signal handler from libjsig actp = (*get_signal_action)(sig); } if (actp == NULL) { // Retrieve the preinstalled signal handler from jvm ! actp = os::Posix::get_preinstalled_handler(sig); } return actp; }
*** 3666,3693 **** } } return chained; } - struct sigaction* os::Solaris::get_preinstalled_handler(int sig) { - assert((chainedsigactions != (struct sigaction *)NULL) && - (preinstalled_sigs != (int *)NULL), "signals not yet initialized"); - if (preinstalled_sigs[sig] != 0) { - return &chainedsigactions[sig]; - } - return NULL; - } - - void os::Solaris::save_preinstalled_handler(int sig, - struct sigaction& oldAct) { - assert(sig > 0 && sig <= Maxsignum, "vm signal out of expected range"); - assert((chainedsigactions != (struct sigaction *)NULL) && - (preinstalled_sigs != (int *)NULL), "signals not yet initialized"); - chainedsigactions[sig] = oldAct; - preinstalled_sigs[sig] = 1; - } - void os::Solaris::set_signal_handler(int sig, bool set_installed, bool oktochain) { // Check for overwrite. struct sigaction oldAct; sigaction(sig, (struct sigaction*)NULL, &oldAct); --- 3658,3667 ----
*** 3701,3711 **** // Do not overwrite; user takes responsibility to forward to us. return; } else if (UseSignalChaining) { if (oktochain) { // save the old handler in jvm ! save_preinstalled_handler(sig, oldAct); } else { vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal."); } // libjsig also interposes the sigaction() call below and saves the // old sigaction on it own. --- 3675,3685 ---- // Do not overwrite; user takes responsibility to forward to us. return; } else if (UseSignalChaining) { if (oktochain) { // save the old handler in jvm ! os::Posix::save_preinstalled_handler(sig, oldAct); } else { vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal."); } // libjsig also interposes the sigaction() call below and saves the // old sigaction on it own.
< prev index next >