< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page




1271   ThreadFunction entry_point() const             { return _entry_point; }
1272 
1273   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1274   void allocate_threadObj(Handle thread_group, const char* thread_name, bool daemon, TRAPS);
1275 
1276   // Last frame anchor routines
1277 
1278   JavaFrameAnchor* frame_anchor(void)            { return &_anchor; }
1279 
1280   // last_Java_sp
1281   bool has_last_Java_frame() const               { return _anchor.has_last_Java_frame(); }
1282   intptr_t* last_Java_sp() const                 { return _anchor.last_Java_sp(); }
1283 
1284   // last_Java_pc
1285 
1286   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
1287 
1288   // Safepoint support
1289   inline JavaThreadState thread_state() const;
1290   inline void set_thread_state(JavaThreadState s);
1291   inline void set_thread_state_fence(JavaThreadState s);  // fence after setting thread state
1292   inline ThreadSafepointState* safepoint_state() const;
1293   inline void set_safepoint_state(ThreadSafepointState* state);
1294   inline bool is_at_poll_safepoint();
1295 
1296   // JavaThread termination and lifecycle support:
1297   void smr_delete();
1298   bool on_thread_list() const { return _on_thread_list; }
1299   void set_on_thread_list() { _on_thread_list = true; }
1300 
1301   // thread has called JavaThread::exit() or is terminated
1302   bool is_exiting() const;
1303   // thread is terminated (no longer on the threads list); we compare
1304   // against the two non-terminated values so that a freed JavaThread
1305   // will also be considered terminated.
1306   bool check_is_terminated(TerminatedTypes l_terminated) const {
1307     return l_terminated != _not_terminated && l_terminated != _thread_exiting;
1308   }
1309   bool is_terminated() const;
1310   void set_terminated(TerminatedTypes t);
1311   // special for Threads::remove() which is static:


1398   // other values in the code. Experiments with all calls can be done
1399   // via the appropriate -XX options.
1400   bool wait_for_ext_suspend_completion(int count, int delay, uint32_t *bits);
1401 
1402   // test for suspend - most (all?) of these should go away
1403   bool is_thread_fully_suspended(bool wait_for_suspend, uint32_t *bits);
1404 
1405   inline void set_external_suspend();
1406   inline void clear_external_suspend();
1407 
1408   inline void set_deopt_suspend();
1409   inline void clear_deopt_suspend();
1410   bool is_deopt_suspend()         { return (_suspend_flags & _deopt_suspend) != 0; }
1411 
1412   bool is_external_suspend() const {
1413     return (_suspend_flags & _external_suspend) != 0;
1414   }
1415   // Whenever a thread transitions from native to vm/java it must suspend
1416   // if external|deopt suspend is present.
1417   bool is_suspend_after_native() const {
1418     return (_suspend_flags & (_external_suspend | _deopt_suspend JFR_ONLY(| _trace_flag))) != 0;
1419   }
1420 
1421   // external suspend request is completed
1422   bool is_ext_suspended() const {
1423     return (_suspend_flags & _ext_suspended) != 0;
1424   }
1425 
1426   bool is_external_suspend_with_lock() const {
1427     MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag);
1428     return is_external_suspend();
1429   }
1430 
1431   // Special method to handle a pending external suspend request
1432   // when a suspend equivalent condition lifts.
1433   bool handle_special_suspend_equivalent_condition() {
1434     assert(is_suspend_equivalent(),
1435            "should only be called in a suspend equivalence condition");
1436     MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag);
1437     bool ret = is_external_suspend();
1438     if (!ret) {




1271   ThreadFunction entry_point() const             { return _entry_point; }
1272 
1273   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1274   void allocate_threadObj(Handle thread_group, const char* thread_name, bool daemon, TRAPS);
1275 
1276   // Last frame anchor routines
1277 
1278   JavaFrameAnchor* frame_anchor(void)            { return &_anchor; }
1279 
1280   // last_Java_sp
1281   bool has_last_Java_frame() const               { return _anchor.has_last_Java_frame(); }
1282   intptr_t* last_Java_sp() const                 { return _anchor.last_Java_sp(); }
1283 
1284   // last_Java_pc
1285 
1286   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
1287 
1288   // Safepoint support
1289   inline JavaThreadState thread_state() const;
1290   inline void set_thread_state(JavaThreadState s);

1291   inline ThreadSafepointState* safepoint_state() const;
1292   inline void set_safepoint_state(ThreadSafepointState* state);
1293   inline bool is_at_poll_safepoint();
1294 
1295   // JavaThread termination and lifecycle support:
1296   void smr_delete();
1297   bool on_thread_list() const { return _on_thread_list; }
1298   void set_on_thread_list() { _on_thread_list = true; }
1299 
1300   // thread has called JavaThread::exit() or is terminated
1301   bool is_exiting() const;
1302   // thread is terminated (no longer on the threads list); we compare
1303   // against the two non-terminated values so that a freed JavaThread
1304   // will also be considered terminated.
1305   bool check_is_terminated(TerminatedTypes l_terminated) const {
1306     return l_terminated != _not_terminated && l_terminated != _thread_exiting;
1307   }
1308   bool is_terminated() const;
1309   void set_terminated(TerminatedTypes t);
1310   // special for Threads::remove() which is static:


1397   // other values in the code. Experiments with all calls can be done
1398   // via the appropriate -XX options.
1399   bool wait_for_ext_suspend_completion(int count, int delay, uint32_t *bits);
1400 
1401   // test for suspend - most (all?) of these should go away
1402   bool is_thread_fully_suspended(bool wait_for_suspend, uint32_t *bits);
1403 
1404   inline void set_external_suspend();
1405   inline void clear_external_suspend();
1406 
1407   inline void set_deopt_suspend();
1408   inline void clear_deopt_suspend();
1409   bool is_deopt_suspend()         { return (_suspend_flags & _deopt_suspend) != 0; }
1410 
1411   bool is_external_suspend() const {
1412     return (_suspend_flags & _external_suspend) != 0;
1413   }
1414   // Whenever a thread transitions from native to vm/java it must suspend
1415   // if external|deopt suspend is present.
1416   bool is_suspend_after_native() const {
1417     return (_suspend_flags & (_external_suspend | _deopt_suspend)) != 0;
1418   }
1419 
1420   // external suspend request is completed
1421   bool is_ext_suspended() const {
1422     return (_suspend_flags & _ext_suspended) != 0;
1423   }
1424 
1425   bool is_external_suspend_with_lock() const {
1426     MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag);
1427     return is_external_suspend();
1428   }
1429 
1430   // Special method to handle a pending external suspend request
1431   // when a suspend equivalent condition lifts.
1432   bool handle_special_suspend_equivalent_condition() {
1433     assert(is_suspend_equivalent(),
1434            "should only be called in a suspend equivalence condition");
1435     MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag);
1436     bool ret = is_external_suspend();
1437     if (!ret) {


< prev index next >