1159 // last_Java_pc
1160
1161 address last_Java_pc(void) { return _anchor.last_Java_pc(); }
1162
1163 // Safepoint support
1164 #if !(defined(PPC64) || defined(AARCH64))
1165 JavaThreadState thread_state() const { return _thread_state; }
1166 void set_thread_state(JavaThreadState s) { _thread_state = s; }
1167 #else
1168 // Use membars when accessing volatile _thread_state. See
1169 // Threads::create_vm() for size checks.
1170 inline JavaThreadState thread_state() const;
1171 inline void set_thread_state(JavaThreadState s);
1172 #endif
1173 ThreadSafepointState *safepoint_state() const { return _safepoint_state; }
1174 void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1175 bool is_at_poll_safepoint() { return _safepoint_state->is_at_poll_safepoint(); }
1176
1177 // JavaThread termination and lifecycle support:
1178 void smr_delete();
1179 bool on_thread_list() { return _on_thread_list; }
1180 void set_on_thread_list() { _on_thread_list = true; }
1181
1182 // thread has called JavaThread::exit() or is terminated
1183 bool is_exiting() const;
1184 // thread is terminated (no longer on the threads list); we compare
1185 // against the two non-terminated values so that a freed JavaThread
1186 // will also be considered terminated.
1187 bool check_is_terminated(TerminatedTypes l_terminated) const {
1188 return l_terminated != _not_terminated && l_terminated != _thread_exiting;
1189 }
1190 bool is_terminated();
1191 void set_terminated(TerminatedTypes t);
1192 // special for Threads::remove() which is static:
1193 void set_terminated_value();
1194 void block_if_vm_exited();
1195
1196 bool doing_unsafe_access() { return _doing_unsafe_access; }
1197 void set_doing_unsafe_access(bool val) { _doing_unsafe_access = val; }
1198
1199 bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; }
1200 void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }
1201
1202 inline void set_polling_page(void* poll_value);
1203 inline volatile void* get_polling_page();
1204
1205 private:
1206 // Support for thread handshake operations
1207 HandshakeState _handshake;
1208 public:
1209 void set_handshake_operation(HandshakeOperation* op) {
1210 _handshake.set_operation(this, op);
|
1159 // last_Java_pc
1160
1161 address last_Java_pc(void) { return _anchor.last_Java_pc(); }
1162
1163 // Safepoint support
1164 #if !(defined(PPC64) || defined(AARCH64))
1165 JavaThreadState thread_state() const { return _thread_state; }
1166 void set_thread_state(JavaThreadState s) { _thread_state = s; }
1167 #else
1168 // Use membars when accessing volatile _thread_state. See
1169 // Threads::create_vm() for size checks.
1170 inline JavaThreadState thread_state() const;
1171 inline void set_thread_state(JavaThreadState s);
1172 #endif
1173 ThreadSafepointState *safepoint_state() const { return _safepoint_state; }
1174 void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1175 bool is_at_poll_safepoint() { return _safepoint_state->is_at_poll_safepoint(); }
1176
1177 // JavaThread termination and lifecycle support:
1178 void smr_delete();
1179 bool on_thread_list() const { return _on_thread_list; }
1180 void set_on_thread_list() { _on_thread_list = true; }
1181
1182 // thread has called JavaThread::exit() or is terminated
1183 bool is_exiting() const;
1184 // thread is terminated (no longer on the threads list); we compare
1185 // against the two non-terminated values so that a freed JavaThread
1186 // will also be considered terminated.
1187 bool check_is_terminated(TerminatedTypes l_terminated) const {
1188 return l_terminated != _not_terminated && l_terminated != _thread_exiting;
1189 }
1190 bool is_terminated() const;
1191 void set_terminated(TerminatedTypes t);
1192 // special for Threads::remove() which is static:
1193 void set_terminated_value();
1194 void block_if_vm_exited();
1195
1196 bool doing_unsafe_access() { return _doing_unsafe_access; }
1197 void set_doing_unsafe_access(bool val) { _doing_unsafe_access = val; }
1198
1199 bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; }
1200 void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }
1201
1202 inline void set_polling_page(void* poll_value);
1203 inline volatile void* get_polling_page();
1204
1205 private:
1206 // Support for thread handshake operations
1207 HandshakeState _handshake;
1208 public:
1209 void set_handshake_operation(HandshakeOperation* op) {
1210 _handshake.set_operation(this, op);
|