< prev index next >

src/share/vm/runtime/thread.hpp

Print this page

        

@@ -94,10 +94,11 @@
 //     - ConcurrentGCThread
 //     - WorkerThread
 //       - GangWorker
 //       - GCTaskThread
 //   - JavaThread
+//     - various subclasses eg CompilerThread, ServiceThread
 //   - WatcherThread
 
 class Thread: public ThreadShadow {
   friend class VMStructs;
   friend class JVMCIVMStructs;

@@ -312,12 +313,11 @@
   Thread();
   virtual ~Thread();
 
   // 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
   virtual void run();
 

@@ -741,10 +741,15 @@
   };
 
   // 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; }
 
   // Printing
   char* name() const { return (char*)"VM Periodic Task Thread"; }
< prev index next >