--- a/hotspot/src/share/vm/runtime/thread.hpp Thu Jul 18 06:47:15 2013 -0400
+++ b/hotspot/src/share/vm/runtime/thread.hpp Wed Jul 17 13:48:15 2013 +0200
@@ -733,6 +733,8 @@
static bool _startable;
volatile static bool _should_terminate; // updated without holding lock
+
+ os::WatcherThreadCrashProtection* _crash_protection;
public:
enum SomeConstants {
delay_interval = 10 // interrupt delay in milliseconds
@@ -760,6 +762,14 @@
// Otherwise the first task to enroll will trigger the start
static void make_startable();
+ void set_crash_protection(os::WatcherThreadCrashProtection* crash_protection) {
+ assert(Thread::current()->is_Watcher_thread(), "Can only be set by WatcherThread");
+ _crash_protection = crash_protection;
+ }
+
+ bool has_crash_protection() const { return _crash_protection != NULL; }
+ os::WatcherThreadCrashProtection* crash_protection() const { return _crash_protection; }
+
private:
int sleep() const;
};