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 |