Path: blob/master/src/hotspot/os/posix/signals_posix.hpp
40930 views
/*1* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef OS_POSIX_SIGNALS_POSIX_HPP25#define OS_POSIX_SIGNALS_POSIX_HPP2627#include "memory/allocation.hpp"28#include "utilities/globalDefinitions.hpp"2930class outputStream;31class Thread;32class OSThread;3334class PosixSignals : public AllStatic {3536public:3738// Signal number used to suspend/resume a thread39static int SR_signum;4041static int init();42// The platform dependent parts of the central hotspot signal handler.43// Returns true if the signal had been recognized and handled, false if not. If true, caller should44// return from signal handling.45static bool pd_hotspot_signal_handler(int sig, siginfo_t* info, ucontext_t* uc, JavaThread* thread);4647static bool is_sig_ignored(int sig);4849static void hotspot_sigmask(Thread* thread);5051static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen);5253// Suspend-resume54static bool do_suspend(OSThread* osthread);55static void do_resume(OSThread* osthread);5657// For signal-chaining58static bool chained_handler(int sig, siginfo_t* siginfo, void* context);5960// Unblock all signals whose delivery cannot be deferred and which, if they happen61// while delivery is blocked, would cause crashes or hangs (see JDK-8252533).62static void unblock_error_signals();63};6465#endif // OS_POSIX_SIGNALS_POSIX_HPP666768