--- old/src/os/posix/vm/vmError_posix.cpp 2017-02-06 12:01:46.960102000 +0100 +++ new/src/os/posix/vm/vmError_posix.cpp 2017-02-06 12:01:46.758094000 +0100 @@ -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;