hotspot/src/os/posix/vm/os_posix.hpp
changeset 18943 7d0ef675e808
parent 13963 e5b53c306fb5
child 22826 3ee6886e718d
child 22234 da823d78ad65
equal deleted inserted replaced
18942:705506c1bf49 18943:7d0ef675e808
    35   static void print_load_average(outputStream* st);
    35   static void print_load_average(outputStream* st);
    36 
    36 
    37 
    37 
    38 };
    38 };
    39 
    39 
       
    40 /*
       
    41  * Crash protection for the watcher thread. Wrap the callback
       
    42  * with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp
       
    43  * back.
       
    44  * To be able to use this - don't take locks, don't rely on destructors,
       
    45  * don't make OS library calls, don't allocate memory, don't print,
       
    46  * don't call code that could leave the heap / memory in an inconsistent state,
       
    47  * or anything else where we are not in control if we suddenly jump out.
       
    48  */
       
    49 class WatcherThreadCrashProtection : public StackObj {
       
    50 public:
       
    51   WatcherThreadCrashProtection();
       
    52   bool call(os::CrashProtectionCallback& cb);
       
    53 
       
    54   static void check_crash_protection(int signal, Thread* thread);
       
    55 private:
       
    56   void restore();
       
    57   sigjmp_buf _jmpbuf;
       
    58 };
    40 
    59 
    41 #endif
    60 #endif