equal
deleted
inserted
replaced
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 |