< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
rev 52211 : [mq]: tinit


 380 #ifdef ASSERT
 381  private:
 382   bool _visited_for_critical_count;
 383 
 384  public:
 385   void set_visited_for_critical_count(bool z) { _visited_for_critical_count = z; }
 386   bool was_visited_for_critical_count() const   { return _visited_for_critical_count; }
 387 #endif
 388 
 389  public:
 390   enum {
 391     is_definitely_current_thread = true
 392   };
 393 
 394   // Constructor
 395   Thread();
 396   virtual ~Thread() = 0;        // Thread is abstract.
 397 
 398   // Manage Thread::current()
 399   void initialize_thread_current();
 400   void clear_thread_current(); // TLS cleanup needed before threads terminate




 401 
 402  public:
 403   // thread entry point
 404   virtual void run();
 405 
 406   // Testers
 407   virtual bool is_VM_thread()       const            { return false; }
 408   virtual bool is_Java_thread()     const            { return false; }
 409   virtual bool is_Compiler_thread() const            { return false; }
 410   virtual bool is_Code_cache_sweeper_thread() const  { return false; }
 411   virtual bool is_hidden_from_external_view() const  { return false; }
 412   virtual bool is_jvmti_agent_thread() const         { return false; }
 413   // True iff the thread can perform GC operations at a safepoint.
 414   // Generally will be true only of VM thread and parallel GC WorkGang
 415   // threads.
 416   virtual bool is_GC_task_thread() const             { return false; }
 417   virtual bool is_Watcher_thread() const             { return false; }
 418   virtual bool is_ConcurrentGC_thread() const        { return false; }
 419   virtual bool is_Named_thread() const               { return false; }
 420   virtual bool is_Worker_thread() const              { return false; }
 421 
 422   // Can this thread make Java upcalls
 423   virtual bool can_call_java() const                 { return false; }
 424 


 626   // Thread local handle area for allocation of handles within the VM
 627   HandleArea* _handle_area;
 628   GrowableArray<Metadata*>* _metadata_handles;
 629 
 630   // Support for stack overflow handling, get_thread, etc.
 631   address          _stack_base;
 632   size_t           _stack_size;
 633   uintptr_t        _self_raw_id;      // used by get_thread (mutable)
 634   int              _lgrp_id;
 635 
 636   volatile void** polling_page_addr() { return &_polling_page; }
 637 
 638  public:
 639   // Stack overflow support
 640   address stack_base() const           { assert(_stack_base != NULL,"Sanity check"); return _stack_base; }
 641   void    set_stack_base(address base) { _stack_base = base; }
 642   size_t  stack_size() const           { return _stack_size; }
 643   void    set_stack_size(size_t size)  { _stack_size = size; }
 644   address stack_end()  const           { return stack_base() - stack_size(); }
 645   void    record_stack_base_and_size();

 646 
 647   bool    on_local_stack(address adr) const {
 648     // QQQ this has knowledge of direction, ought to be a stack method
 649     return (_stack_base >= adr && adr >= stack_end());
 650   }
 651 
 652   uintptr_t self_raw_id()                    { return _self_raw_id; }
 653   void      set_self_raw_id(uintptr_t value) { _self_raw_id = value; }
 654 
 655   int     lgrp_id() const        { return _lgrp_id; }
 656   void    set_lgrp_id(int value) { _lgrp_id = value; }
 657 
 658   // Printing
 659   void print_on(outputStream* st, bool print_extended_info) const;
 660   virtual void print_on(outputStream* st) const { print_on(st, false); }
 661   void print() const { print_on(tty); }
 662   virtual void print_on_error(outputStream* st, char* buf, int buflen) const;
 663   void print_value_on(outputStream* st) const;
 664 
 665   // Debug-only code




 380 #ifdef ASSERT
 381  private:
 382   bool _visited_for_critical_count;
 383 
 384  public:
 385   void set_visited_for_critical_count(bool z) { _visited_for_critical_count = z; }
 386   bool was_visited_for_critical_count() const   { return _visited_for_critical_count; }
 387 #endif
 388 
 389  public:
 390   enum {
 391     is_definitely_current_thread = true
 392   };
 393 
 394   // Constructor
 395   Thread();
 396   virtual ~Thread() = 0;        // Thread is abstract.
 397 
 398   // Manage Thread::current()
 399   void initialize_thread_current();
 400   static void clear_thread_current(); // TLS cleanup needed before threads terminate
 401 
 402  protected:
 403   // To be implemented by children.
 404   virtual void run() = 0;
 405 
 406  public:
 407   // invokes <ChildThreadClass>::run(), with common preparations and cleanups.
 408   void call_run();
 409 
 410   // Testers
 411   virtual bool is_VM_thread()       const            { return false; }
 412   virtual bool is_Java_thread()     const            { return false; }
 413   virtual bool is_Compiler_thread() const            { return false; }
 414   virtual bool is_Code_cache_sweeper_thread() const  { return false; }
 415   virtual bool is_hidden_from_external_view() const  { return false; }
 416   virtual bool is_jvmti_agent_thread() const         { return false; }
 417   // True iff the thread can perform GC operations at a safepoint.
 418   // Generally will be true only of VM thread and parallel GC WorkGang
 419   // threads.
 420   virtual bool is_GC_task_thread() const             { return false; }
 421   virtual bool is_Watcher_thread() const             { return false; }
 422   virtual bool is_ConcurrentGC_thread() const        { return false; }
 423   virtual bool is_Named_thread() const               { return false; }
 424   virtual bool is_Worker_thread() const              { return false; }
 425 
 426   // Can this thread make Java upcalls
 427   virtual bool can_call_java() const                 { return false; }
 428 


 630   // Thread local handle area for allocation of handles within the VM
 631   HandleArea* _handle_area;
 632   GrowableArray<Metadata*>* _metadata_handles;
 633 
 634   // Support for stack overflow handling, get_thread, etc.
 635   address          _stack_base;
 636   size_t           _stack_size;
 637   uintptr_t        _self_raw_id;      // used by get_thread (mutable)
 638   int              _lgrp_id;
 639 
 640   volatile void** polling_page_addr() { return &_polling_page; }
 641 
 642  public:
 643   // Stack overflow support
 644   address stack_base() const           { assert(_stack_base != NULL,"Sanity check"); return _stack_base; }
 645   void    set_stack_base(address base) { _stack_base = base; }
 646   size_t  stack_size() const           { return _stack_size; }
 647   void    set_stack_size(size_t size)  { _stack_size = size; }
 648   address stack_end()  const           { return stack_base() - stack_size(); }
 649   void    record_stack_base_and_size();
 650   void    register_thread_stack_with_NMT() NOT_NMT_RETURN;
 651 
 652   bool    on_local_stack(address adr) const {
 653     // QQQ this has knowledge of direction, ought to be a stack method
 654     return (_stack_base >= adr && adr >= stack_end());
 655   }
 656 
 657   uintptr_t self_raw_id()                    { return _self_raw_id; }
 658   void      set_self_raw_id(uintptr_t value) { _self_raw_id = value; }
 659 
 660   int     lgrp_id() const        { return _lgrp_id; }
 661   void    set_lgrp_id(int value) { _lgrp_id = value; }
 662 
 663   // Printing
 664   void print_on(outputStream* st, bool print_extended_info) const;
 665   virtual void print_on(outputStream* st) const { print_on(st, false); }
 666   void print() const { print_on(tty); }
 667   virtual void print_on_error(outputStream* st, char* buf, int buflen) const;
 668   void print_value_on(outputStream* st) const;
 669 
 670   // Debug-only code


< prev index next >