src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6814943 Sdiff src/share/vm/runtime

src/share/vm/runtime/thread.hpp

Print this page
rev 1962 : 6814943: getcpool001 catches more than one JvmtiThreadState problem
Summary: Mark field volatile, use membars, and change access order to close race
Reviewed-by:


 770   volatile JavaThreadState _thread_state;
 771  private:
 772   ThreadSafepointState *_safepoint_state;        // Holds information about a thread during a safepoint
 773   address               _saved_exception_pc;     // Saved pc of instruction where last implicit exception happened
 774 
 775   // JavaThread termination support
 776   enum TerminatedTypes {
 777     _not_terminated = 0xDEAD - 2,
 778     _thread_exiting,                             // JavaThread::exit() has been called for this thread
 779     _thread_terminated,                          // JavaThread is removed from thread list
 780     _vm_exited                                   // JavaThread is still executing native code, but VM is terminated
 781                                                  // only VM_Exit can set _vm_exited
 782   };
 783 
 784   // In general a JavaThread's _terminated field transitions as follows:
 785   //
 786   //   _not_terminated => _thread_exiting => _thread_terminated
 787   //
 788   // _vm_exited is a special value to cover the case of a JavaThread
 789   // executing native code after the VM itself is terminated.
 790   TerminatedTypes       _terminated;
 791   // suspend/resume support
 792   volatile bool         _suspend_equivalent;     // Suspend equivalent condition
 793   jint                  _in_deopt_handler;       // count of deoptimization
 794                                                  // handlers thread is in
 795   volatile bool         _doing_unsafe_access;    // Thread may fault due to unsafe access
 796   bool                  _do_not_unlock_if_synchronized; // Do not unlock the receiver of a synchronized method (since it was
 797                                                  // never locked) when throwing an exception. Used by interpreter only.
 798 
 799   //  Flag to mark a JNI thread in the process of attaching - See CR 6404306
 800   //  This flag is never set true other than at construction, and in that case
 801   //  is shortly thereafter set false
 802   volatile bool _is_attaching;
 803 
 804  public:
 805   // State of the stack guard pages for this thread.
 806   enum StackGuardState {
 807     stack_guard_unused,         // not needed
 808     stack_guard_yellow_disabled,// disabled (temporarily) after stack overflow
 809     stack_guard_enabled         // enabled
 810   };




 770   volatile JavaThreadState _thread_state;
 771  private:
 772   ThreadSafepointState *_safepoint_state;        // Holds information about a thread during a safepoint
 773   address               _saved_exception_pc;     // Saved pc of instruction where last implicit exception happened
 774 
 775   // JavaThread termination support
 776   enum TerminatedTypes {
 777     _not_terminated = 0xDEAD - 2,
 778     _thread_exiting,                             // JavaThread::exit() has been called for this thread
 779     _thread_terminated,                          // JavaThread is removed from thread list
 780     _vm_exited                                   // JavaThread is still executing native code, but VM is terminated
 781                                                  // only VM_Exit can set _vm_exited
 782   };
 783 
 784   // In general a JavaThread's _terminated field transitions as follows:
 785   //
 786   //   _not_terminated => _thread_exiting => _thread_terminated
 787   //
 788   // _vm_exited is a special value to cover the case of a JavaThread
 789   // executing native code after the VM itself is terminated.
 790   volatile TerminatedTypes _terminated;
 791   // suspend/resume support
 792   volatile bool         _suspend_equivalent;     // Suspend equivalent condition
 793   jint                  _in_deopt_handler;       // count of deoptimization
 794                                                  // handlers thread is in
 795   volatile bool         _doing_unsafe_access;    // Thread may fault due to unsafe access
 796   bool                  _do_not_unlock_if_synchronized; // Do not unlock the receiver of a synchronized method (since it was
 797                                                  // never locked) when throwing an exception. Used by interpreter only.
 798 
 799   //  Flag to mark a JNI thread in the process of attaching - See CR 6404306
 800   //  This flag is never set true other than at construction, and in that case
 801   //  is shortly thereafter set false
 802   volatile bool _is_attaching;
 803 
 804  public:
 805   // State of the stack guard pages for this thread.
 806   enum StackGuardState {
 807     stack_guard_unused,         // not needed
 808     stack_guard_yellow_disabled,// disabled (temporarily) after stack overflow
 809     stack_guard_enabled         // enabled
 810   };


src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File