This commit is contained in:
David Holmes 2015-11-16 23:12:36 +01:00
commit 98231a9c42
4 changed files with 11 additions and 27 deletions

View File

@ -91,10 +91,6 @@
#define SHUTDOWN1_SIGNAL SIGHUP /* Shutdown Hooks support. */
#define SHUTDOWN2_SIGNAL SIGINT
#define SHUTDOWN3_SIGNAL SIGTERM
/* alternative signals used with -XX:+UseAltSigs (or for backward
compatibility with 1.2, -Xusealtsigs) flag. Chosen to be
unlikely to conflict with applications embedding the vm */
#define ALT_ASYNC_SIGNAL (SIGRTMIN + SIGRTMAX)/2 /* alternate async signal */
/* With 1.4.1 libjsig added versioning: used in os_solaris.cpp and jsig.c */
#define JSIG_VERSION_1_4_1 0x30140100

View File

@ -997,9 +997,8 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
}
// defined for >= Solaris 10. This allows builds on earlier versions
// of Solaris to take advantage of the newly reserved Solaris JVM signals
// With SIGJVM1, SIGJVM2, ASYNC_SIGNAL is SIGJVM2 and -XX:+UseAltSigs does
// nothing since these should have no conflict. Previously INTERRUPT_SIGNAL
// of Solaris to take advantage of the newly reserved Solaris JVM signals.
// With SIGJVM1, SIGJVM2, ASYNC_SIGNAL is SIGJVM2. Previously INTERRUPT_SIGNAL
// was SIGJVM1.
//
#if !defined(SIGJVM1)
@ -1053,13 +1052,9 @@ void os::Solaris::signal_sets_init() {
sigaddset(&unblocked_sigs, SIGBUS);
sigaddset(&unblocked_sigs, SIGFPE);
if (isJVM1available) {
os::Solaris::set_SIGasync(SIGJVM2);
} else if (UseAltSigs) {
os::Solaris::set_SIGasync(ALT_ASYNC_SIGNAL);
} else {
os::Solaris::set_SIGasync(ASYNC_SIGNAL);
}
// Always true on Solaris 10+
guarantee(isJVM1available(), "SIGJVM1/2 missing!");
os::Solaris::set_SIGasync(SIGJVM2);
sigaddset(&unblocked_sigs, os::Solaris::SIGasync());
@ -3922,7 +3917,7 @@ void os::Solaris::set_signal_handler(int sig, bool set_installed,
// save the old handler in jvm
save_preinstalled_handler(sig, oldAct);
} else {
vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs.");
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.
@ -3991,7 +3986,7 @@ void os::run_periodic_checks() {
DO_SIGNAL_CHECK(BREAK_SIGNAL);
}
// See comments above for using JVM1/JVM2 and UseAltSigs
// See comments above for using JVM1/JVM2
DO_SIGNAL_CHECK(os::Solaris::SIGasync());
}

View File

@ -366,6 +366,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
@ -2949,11 +2950,12 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
round_to((int)long_ThreadStackSize, K) / K) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xoss, -Xsqnopause, -Xoptimize, -Xboundthreads
// -Xoss, -Xsqnopause, -Xoptimize, -Xboundthreads, -Xusealtsigs
} else if (match_option(option, "-Xoss", &tail) ||
match_option(option, "-Xsqnopause") ||
match_option(option, "-Xoptimize") ||
match_option(option, "-Xboundthreads")) {
match_option(option, "-Xboundthreads") ||
match_option(option, "-Xusealtsigs")) {
// All these options are deprecated in JDK 9 and will be removed in a future release
char version[256];
JDK_Version::jdk(9).to_string(version, sizeof(version));
@ -3036,11 +3038,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-Xusealtsigs")) {
// change default internal VM signals used - lower case for back compat
if (FLAG_SET_CMDLINE(bool, UseAltSigs, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xprof
} else if (match_option(option, "-Xprof")) {
#if INCLUDE_FPROF

View File

@ -1334,10 +1334,6 @@ public:
"Use signal-chaining to invoke signal handlers installed " \
"by the application (Solaris & Linux only)") \
\
product(bool, UseAltSigs, false, \
"Use alternate signals instead of SIGUSR1 & SIGUSR2 for VM " \
"internal signals (Solaris only)") \
\
product(bool, AllowJNIEnvProxy, false, \
"Allow JNIEnv proxies for jdbx") \
\