mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8134537: Much nearly duplicated code for sun.misc.Signal support
Merged jvm_<os>.cpp into jvm_posix.cpp Reviewed-by: dholmes, stuefe
This commit is contained in:
parent
87ca9d07df
commit
ab469d40fc
14 changed files with 32 additions and 400 deletions
|
@ -1026,18 +1026,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
|
|||
debug_only(static bool signal_sets_initialized = false);
|
||||
static sigset_t unblocked_sigs, vm_sigs;
|
||||
|
||||
bool os::Solaris::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void os::Solaris::signal_sets_init() {
|
||||
// Should also have an assertion stating we are still single-threaded.
|
||||
assert(!signal_sets_initialized, "Already initialized");
|
||||
|
@ -1062,13 +1050,13 @@ void os::Solaris::signal_sets_init() {
|
|||
sigaddset(&unblocked_sigs, ASYNC_SIGNAL);
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN1_SIGNAL);
|
||||
}
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN2_SIGNAL);
|
||||
}
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN3_SIGNAL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue