< prev index next >

src/os/posix/vm/os_posix.hpp

Print this page

        

*** 60,84 **** static void print_siginfo_brief(outputStream* os, const siginfo_t* si); }; /* ! * Crash protection for the watcher thread. Wrap the callback * with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp * back. * To be able to use this - don't take locks, don't rely on destructors, * don't make OS library calls, don't allocate memory, don't print, * don't call code that could leave the heap / memory in an inconsistent state, * or anything else where we are not in control if we suddenly jump out. */ ! class WatcherThreadCrashProtection : public StackObj { public: ! WatcherThreadCrashProtection(); bool call(os::CrashProtectionCallback& cb); static void check_crash_protection(int signal, Thread* thread); private: void restore(); sigjmp_buf _jmpbuf; }; #endif // OS_POSIX_VM_OS_POSIX_HPP --- 60,91 ---- static void print_siginfo_brief(outputStream* os, const siginfo_t* si); }; /* ! * Crash protection utility used by JFR. Wrap the callback * with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp * back. * To be able to use this - don't take locks, don't rely on destructors, * don't make OS library calls, don't allocate memory, don't print, * don't call code that could leave the heap / memory in an inconsistent state, * or anything else where we are not in control if we suddenly jump out. */ ! class ThreadCrashProtection : public StackObj { public: ! static bool is_crash_protected(Thread* thr) { ! return _crash_protection != NULL && _protected_thread == thr; ! } ! ! ThreadCrashProtection(); bool call(os::CrashProtectionCallback& cb); static void check_crash_protection(int signal, Thread* thread); private: + static Thread* _protected_thread; + static ThreadCrashProtection* _crash_protection; + static volatile intptr_t _crash_mux; void restore(); sigjmp_buf _jmpbuf; }; #endif // OS_POSIX_VM_OS_POSIX_HPP
< prev index next >