8288497: add support for JavaThread::is_oop_safe()

Reviewed-by: pchilanomate, dholmes, rehn, eosterlund
This commit is contained in:
Daniel D. Daugherty 2022-06-21 16:08:09 +00:00
parent c74a9235fc
commit e26d3b3c01
4 changed files with 31 additions and 12 deletions

View file

@ -3599,6 +3599,12 @@ void Threads::remove(JavaThread* p, bool is_daemon) {
// StackWatermarkSet::on_safepoint(), which performs GC processing,
// requiring the GC state to be alive.
BarrierSet::barrier_set()->on_thread_detach(p);
if (p->is_exiting()) {
// If we got here via JavaThread::exit(), then we remember that the
// thread's GC barrier has been detached. We don't do this when we get
// here from another path, e.g., cleanup_failed_attach_current_thread().
p->set_terminated(JavaThread::_thread_gc_barrier_detached);
}
assert(ThreadsSMRSupport::get_java_thread_list()->includes(p), "p must be present");