< prev index next >

src/hotspot/share/runtime/osThread.hpp

Print this page




  65   volatile jint _interrupted;     // Thread.isInterrupted state
  66 
  67   // Note:  _interrupted must be jint, so that Java intrinsics can access it.
  68   // The value stored there must be either 0 or 1.  It must be possible
  69   // for Java to emulate Thread.currentThread().isInterrupted() by performing
  70   // the double indirection Thread::current()->_osthread->_interrupted.
  71 
  72   // Methods
  73  public:
  74   void set_state(ThreadState state)                { _state = state; }
  75   ThreadState get_state()                          { return _state; }
  76 
  77   OSThread(OSThreadStartFunc start_proc, void* start_parm);
  78   ~OSThread();
  79 
  80   // Accessors
  81   OSThreadStartFunc start_proc() const              { return _start_proc; }
  82   void set_start_proc(OSThreadStartFunc start_proc) { _start_proc = start_proc; }
  83   void* start_parm() const                          { return _start_parm; }
  84   void set_start_parm(void* start_parm)             { _start_parm = start_parm; }
  85 

  86   volatile bool interrupted() const                 { return _interrupted != 0; }
  87   void set_interrupted(bool z)                      { _interrupted = z ? 1 : 0; }
  88 
  89   // Printing
  90   void print_on(outputStream* st) const;
  91   void print() const;
  92 
  93   // For java intrinsics:
  94   static ByteSize interrupted_offset()            { return byte_offset_of(OSThread, _interrupted); }
  95 
  96   // Platform dependent stuff
  97 #include OS_HEADER(osThread)
  98 
  99  public:
 100   static ByteSize thread_id_offset()              { return byte_offset_of(OSThread, _thread_id); }
 101   static size_t thread_id_size()                  { return sizeof(thread_id_t); }
 102 
 103   thread_id_t thread_id() const                   { return _thread_id; }
 104 
 105   void set_thread_id(thread_id_t id)              { _thread_id = id; }
 106 
 107  private:
 108   // _thread_id is kernel thread id (similar to LWP id on Solaris). Each




  65   volatile jint _interrupted;     // Thread.isInterrupted state
  66 
  67   // Note:  _interrupted must be jint, so that Java intrinsics can access it.
  68   // The value stored there must be either 0 or 1.  It must be possible
  69   // for Java to emulate Thread.currentThread().isInterrupted() by performing
  70   // the double indirection Thread::current()->_osthread->_interrupted.
  71 
  72   // Methods
  73  public:
  74   void set_state(ThreadState state)                { _state = state; }
  75   ThreadState get_state()                          { return _state; }
  76 
  77   OSThread(OSThreadStartFunc start_proc, void* start_parm);
  78   ~OSThread();
  79 
  80   // Accessors
  81   OSThreadStartFunc start_proc() const              { return _start_proc; }
  82   void set_start_proc(OSThreadStartFunc start_proc) { _start_proc = start_proc; }
  83   void* start_parm() const                          { return _start_parm; }
  84   void set_start_parm(void* start_parm)             { _start_parm = start_parm; }
  85   // These are specialized on Windows.
  86 #ifndef _WINDOWS
  87   volatile bool interrupted() const                 { return _interrupted != 0; }
  88   void set_interrupted(bool z)                      { _interrupted = z ? 1 : 0; }
  89 #endif
  90   // Printing
  91   void print_on(outputStream* st) const;
  92   void print() const;
  93 
  94   // For java intrinsics:
  95   static ByteSize interrupted_offset()            { return byte_offset_of(OSThread, _interrupted); }
  96 
  97   // Platform dependent stuff
  98 #include OS_HEADER(osThread)
  99 
 100  public:
 101   static ByteSize thread_id_offset()              { return byte_offset_of(OSThread, _thread_id); }
 102   static size_t thread_id_size()                  { return sizeof(thread_id_t); }
 103 
 104   thread_id_t thread_id() const                   { return _thread_id; }
 105 
 106   void set_thread_id(thread_id_t id)              { _thread_id = id; }
 107 
 108  private:
 109   // _thread_id is kernel thread id (similar to LWP id on Solaris). Each


< prev index next >