hotspot/src/share/vm/runtime/thread.hpp
changeset 14390 bd0d881cf1c5
parent 14083 103054a71a30
child 14582 490bb6c0df7c
equal deleted inserted replaced
14389:655c5b5f7486 14390:bd0d881cf1c5
   720   virtual void run();
   720   virtual void run();
   721 
   721 
   722  private:
   722  private:
   723   static WatcherThread* _watcher_thread;
   723   static WatcherThread* _watcher_thread;
   724 
   724 
       
   725   static bool _startable;
   725   volatile static bool _should_terminate; // updated without holding lock
   726   volatile static bool _should_terminate; // updated without holding lock
   726  public:
   727  public:
   727   enum SomeConstants {
   728   enum SomeConstants {
   728     delay_interval = 10                          // interrupt delay in milliseconds
   729     delay_interval = 10                          // interrupt delay in milliseconds
   729   };
   730   };
   736 
   737 
   737   // Printing
   738   // Printing
   738   char* name() const { return (char*)"VM Periodic Task Thread"; }
   739   char* name() const { return (char*)"VM Periodic Task Thread"; }
   739   void print_on(outputStream* st) const;
   740   void print_on(outputStream* st) const;
   740   void print() const { print_on(tty); }
   741   void print() const { print_on(tty); }
       
   742   void unpark();
   741 
   743 
   742   // Returns the single instance of WatcherThread
   744   // Returns the single instance of WatcherThread
   743   static WatcherThread* watcher_thread()         { return _watcher_thread; }
   745   static WatcherThread* watcher_thread()         { return _watcher_thread; }
   744 
   746 
   745   // Create and start the single instance of WatcherThread, or stop it on shutdown
   747   // Create and start the single instance of WatcherThread, or stop it on shutdown
   746   static void start();
   748   static void start();
   747   static void stop();
   749   static void stop();
       
   750   // Only allow start once the VM is sufficiently initialized
       
   751   // Otherwise the first task to enroll will trigger the start
       
   752   static void make_startable();
       
   753 
       
   754  private:
       
   755   int sleep() const;
   748 };
   756 };
   749 
   757 
   750 
   758 
   751 class CompilerThread;
   759 class CompilerThread;
   752 
   760