< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
rev 57095 : [mq]: use
rev 57096 : [mq]: trailing_semi


 857   virtual void pre_run();
 858   virtual void post_run();
 859 
 860  public:
 861   NonJavaThread();
 862   ~NonJavaThread();
 863 
 864   class Iterator;
 865 };
 866 
 867 // Provides iteration over the list of NonJavaThreads.
 868 // List addition occurs in pre_run(), and removal occurs in post_run(),
 869 // so that only live fully-initialized threads can be found in the list.
 870 // Threads created after an iterator is constructed will not be visited
 871 // by the iterator. The scope of an iterator is a critical section; there
 872 // must be no safepoint checks in that scope.
 873 class NonJavaThread::Iterator : public StackObj {
 874   uint _protect_enter;
 875   NonJavaThread* _current;
 876 
 877   // Noncopyable.
 878   Iterator(const Iterator&);
 879   Iterator& operator=(const Iterator&);
 880 
 881 public:
 882   Iterator();
 883   ~Iterator();
 884 
 885   bool end() const { return _current == NULL; }
 886   NonJavaThread* current() const { return _current; }
 887   void step();
 888 };
 889 
 890 // Name support for threads.  non-JavaThread subclasses with multiple
 891 // uniquely named instances should derive from this.
 892 class NamedThread: public NonJavaThread {
 893   friend class VMStructs;
 894   enum {
 895     max_name_len = 64
 896   };
 897  private:
 898   char* _name;
 899   // log JavaThread being processed by oops_do




 857   virtual void pre_run();
 858   virtual void post_run();
 859 
 860  public:
 861   NonJavaThread();
 862   ~NonJavaThread();
 863 
 864   class Iterator;
 865 };
 866 
 867 // Provides iteration over the list of NonJavaThreads.
 868 // List addition occurs in pre_run(), and removal occurs in post_run(),
 869 // so that only live fully-initialized threads can be found in the list.
 870 // Threads created after an iterator is constructed will not be visited
 871 // by the iterator. The scope of an iterator is a critical section; there
 872 // must be no safepoint checks in that scope.
 873 class NonJavaThread::Iterator : public StackObj {
 874   uint _protect_enter;
 875   NonJavaThread* _current;
 876 
 877   NONCOPYABLE(Iterator);


 878 
 879 public:
 880   Iterator();
 881   ~Iterator();
 882 
 883   bool end() const { return _current == NULL; }
 884   NonJavaThread* current() const { return _current; }
 885   void step();
 886 };
 887 
 888 // Name support for threads.  non-JavaThread subclasses with multiple
 889 // uniquely named instances should derive from this.
 890 class NamedThread: public NonJavaThread {
 891   friend class VMStructs;
 892   enum {
 893     max_name_len = 64
 894   };
 895  private:
 896   char* _name;
 897   // log JavaThread being processed by oops_do


< prev index next >