hotspot/src/share/vm/runtime/thread.hpp
changeset 25351 7c198a690050
parent 25064 244218e6ec0a
child 25490 59f226da8d81
child 25468 5331df506290
equal deleted inserted replaced
25350:6423a57e5451 25351:7c198a690050
   341   ObjectMonitor** omInUseList_addr()             { return (ObjectMonitor **)&omInUseList; }
   341   ObjectMonitor** omInUseList_addr()             { return (ObjectMonitor **)&omInUseList; }
   342   Monitor* SR_lock() const                       { return _SR_lock; }
   342   Monitor* SR_lock() const                       { return _SR_lock; }
   343 
   343 
   344   bool has_async_exception() const { return (_suspend_flags & _has_async_exception) != 0; }
   344   bool has_async_exception() const { return (_suspend_flags & _has_async_exception) != 0; }
   345 
   345 
   346   void set_suspend_flag(SuspendFlags f) {
   346   inline void set_suspend_flag(SuspendFlags f);
   347     assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch");
   347   inline void clear_suspend_flag(SuspendFlags f);
   348     uint32_t flags;
   348 
   349     do {
   349   inline void set_has_async_exception();
   350       flags = _suspend_flags;
   350   inline void clear_has_async_exception();
   351     }
       
   352     while (Atomic::cmpxchg((jint)(flags | f),
       
   353                            (volatile jint*)&_suspend_flags,
       
   354                            (jint)flags) != (jint)flags);
       
   355   }
       
   356   void clear_suspend_flag(SuspendFlags f) {
       
   357     assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch");
       
   358     uint32_t flags;
       
   359     do {
       
   360       flags = _suspend_flags;
       
   361     }
       
   362     while (Atomic::cmpxchg((jint)(flags & ~f),
       
   363                            (volatile jint*)&_suspend_flags,
       
   364                            (jint)flags) != (jint)flags);
       
   365   }
       
   366 
       
   367   void set_has_async_exception() {
       
   368     set_suspend_flag(_has_async_exception);
       
   369   }
       
   370   void clear_has_async_exception() {
       
   371     clear_suspend_flag(_has_async_exception);
       
   372   }
       
   373 
   351 
   374   bool do_critical_native_unlock() const { return (_suspend_flags & _critical_native_unlock) != 0; }
   352   bool do_critical_native_unlock() const { return (_suspend_flags & _critical_native_unlock) != 0; }
   375 
   353 
   376   void set_critical_native_unlock() {
   354   inline void set_critical_native_unlock();
   377     set_suspend_flag(_critical_native_unlock);
   355   inline void clear_critical_native_unlock();
   378   }
       
   379   void clear_critical_native_unlock() {
       
   380     clear_suspend_flag(_critical_native_unlock);
       
   381   }
       
   382 
   356 
   383   // Support for Unhandled Oop detection
   357   // Support for Unhandled Oop detection
   384 #ifdef CHECK_UNHANDLED_OOPS
   358 #ifdef CHECK_UNHANDLED_OOPS
   385  private:
   359  private:
   386   UnhandledOops* _unhandled_oops;
   360   UnhandledOops* _unhandled_oops;
  1072   MemRecorder* volatile _recorder;
  1046   MemRecorder* volatile _recorder;
  1073 #endif // INCLUDE_NMT
  1047 #endif // INCLUDE_NMT
  1074 
  1048 
  1075   // Suspend/resume support for JavaThread
  1049   // Suspend/resume support for JavaThread
  1076  private:
  1050  private:
  1077   void set_ext_suspended()       { set_suspend_flag (_ext_suspended);  }
  1051   inline void set_ext_suspended();
  1078   void clear_ext_suspended()     { clear_suspend_flag(_ext_suspended); }
  1052   inline void clear_ext_suspended();
  1079 
  1053 
  1080  public:
  1054  public:
  1081   void java_suspend();
  1055   void java_suspend();
  1082   void java_resume();
  1056   void java_resume();
  1083   int  java_suspend_self();
  1057   int  java_suspend_self();
  1121   // calls to wait_for_ext_suspend_completion() can be done by passing
  1095   // calls to wait_for_ext_suspend_completion() can be done by passing
  1122   // other values in the code. Experiments with all calls can be done
  1096   // other values in the code. Experiments with all calls can be done
  1123   // via the appropriate -XX options.
  1097   // via the appropriate -XX options.
  1124   bool wait_for_ext_suspend_completion(int count, int delay, uint32_t *bits);
  1098   bool wait_for_ext_suspend_completion(int count, int delay, uint32_t *bits);
  1125 
  1099 
  1126   void set_external_suspend()     { set_suspend_flag  (_external_suspend); }
  1100   inline void set_external_suspend();
  1127   void clear_external_suspend()   { clear_suspend_flag(_external_suspend); }
  1101   inline void clear_external_suspend();
  1128 
  1102 
  1129   void set_deopt_suspend()        { set_suspend_flag  (_deopt_suspend); }
  1103   inline void set_deopt_suspend();
  1130   void clear_deopt_suspend()      { clear_suspend_flag(_deopt_suspend); }
  1104   inline void clear_deopt_suspend();
  1131   bool is_deopt_suspend()         { return (_suspend_flags & _deopt_suspend) != 0; }
  1105   bool is_deopt_suspend()         { return (_suspend_flags & _deopt_suspend) != 0; }
  1132 
  1106 
  1133   bool is_external_suspend() const {
  1107   bool is_external_suspend() const {
  1134     return (_suspend_flags & _external_suspend) != 0;
  1108     return (_suspend_flags & _external_suspend) != 0;
  1135   }
  1109   }
  1213             is_external_suspend() || is_deopt_suspend();
  1187             is_external_suspend() || is_deopt_suspend();
  1214   }
  1188   }
  1215 
  1189 
  1216   void set_pending_unsafe_access_error()          { _special_runtime_exit_condition = _async_unsafe_access_error; }
  1190   void set_pending_unsafe_access_error()          { _special_runtime_exit_condition = _async_unsafe_access_error; }
  1217 
  1191 
  1218   void set_pending_async_exception(oop e) {
  1192   inline void set_pending_async_exception(oop e);
  1219     _pending_async_exception = e;
       
  1220     _special_runtime_exit_condition = _async_exception;
       
  1221     set_has_async_exception();
       
  1222   }
       
  1223 
  1193 
  1224   // Fast-locking support
  1194   // Fast-locking support
  1225   bool is_lock_owned(address adr) const;
  1195   bool is_lock_owned(address adr) const;
  1226 
  1196 
  1227   // Accessors for vframe array top
  1197   // Accessors for vframe array top