Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/hotspot/os/posix/signals_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ static address get_signal_handler(const struct sigaction* action) {

typedef int (*os_sigaction_t)(int, const struct sigaction *, struct sigaction *);

static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context);
static void SR_handler(int sig, siginfo_t* siginfo, void* ucVoid);

// Semantically compare two sigaction structures. Return true if they are referring to
// the same handler, using the same flags.
Expand Down Expand Up @@ -1565,8 +1565,8 @@ static void resume_clear_context(OSThread *osthread) {
osthread->set_siginfo(NULL);
}

static void suspend_save_context(OSThread *osthread, siginfo_t* siginfo, ucontext_t* context) {
osthread->set_ucontext(context);
static void suspend_save_context(OSThread *osthread, siginfo_t* siginfo, void* ucVoid) {
osthread->set_ucontext((ucontext_t*)ucVoid);
osthread->set_siginfo(siginfo);
}

Expand All @@ -1583,7 +1583,7 @@ static void suspend_save_context(OSThread *osthread, siginfo_t* siginfo, ucontex
//
// Currently only ever called on the VMThread and JavaThreads (PC sampling)
//
static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
static void SR_handler(int sig, siginfo_t* siginfo, void* ucVoid) {

// Save and restore errno to avoid confusing native code with EINTR
// after sigsuspend.
Expand Down Expand Up @@ -1611,7 +1611,7 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
os::SuspendResume::State current = osthread->sr.state();

if (current == os::SuspendResume::SR_SUSPEND_REQUEST) {
suspend_save_context(osthread, siginfo, context);
suspend_save_context(osthread, siginfo, ucVoid);

// attempt to switch the state, we assume we had a SUSPEND_REQUEST
os::SuspendResume::State state = osthread->sr.suspended();
Expand Down Expand Up @@ -1680,7 +1680,7 @@ int SR_initialize() {

// Set up signal handler for suspend/resume
act.sa_flags = SA_RESTART|SA_SIGINFO;
act.sa_handler = (void (*)(int)) SR_handler;
act.sa_sigaction = SR_handler;

// SR_signum is blocked by default.
pthread_sigmask(SIG_BLOCK, NULL, &act.sa_mask);
Expand Down