--- a/hotspot/src/share/vm/runtime/thread.hpp Wed May 11 00:40:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/thread.hpp Wed May 11 01:02:28 2016 -0400
@@ -96,6 +96,7 @@
// - GangWorker
// - GCTaskThread
// - JavaThread
+// - various subclasses eg CompilerThread, ServiceThread
// - WatcherThread
class Thread: public ThreadShadow {
@@ -314,8 +315,7 @@
// Manage Thread::current()
void initialize_thread_current();
- private:
- void clear_thread_current(); // needed for detaching JNI threads
+ void clear_thread_current(); // TLS cleanup needed before threads terminate
public:
// thread entry point
@@ -743,6 +743,11 @@
// Constructor
WatcherThread();
+ // No destruction allowed
+ ~WatcherThread() {
+ guarantee(false, "WatcherThread deletion must fix the race with VM termination");
+ }
+
// Tester
bool is_Watcher_thread() const { return true; }