--- a/hotspot/src/os/posix/vm/vmError_posix.cpp Thu Feb 23 11:57:07 2017 +0100
+++ b/hotspot/src/os/posix/vm/vmError_posix.cpp Thu Feb 23 15:59:14 2017 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,21 @@
static int resettedSigflags[NUM_SIGNALS];
static address resettedSighandler[NUM_SIGNALS];
+// Needed for cancelable steps.
+static volatile pthread_t reporter_thread_id;
+
+void VMError::reporting_started() {
+ // record pthread id of reporter thread.
+ reporter_thread_id = ::pthread_self();
+}
+
+void VMError::interrupt_reporting_thread() {
+ // We misuse SIGILL here, but it does not really matter. We need
+ // a signal which is handled by crash_handler and not likely to
+ // occurr during error reporting itself.
+ ::pthread_kill(reporter_thread_id, SIGILL);
+}
+
static void save_signal(int idx, int sig)
{
struct sigaction sa;