< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page
rev 54186 : 8221086: Shenandoah-specific workaround for JDK-8220671

*** 1309,1334 **** } } } void NonJavaThread::pre_run() { // Initialize BarrierSet-related data before adding to list. assert(BarrierSet::barrier_set() != NULL, "invariant"); BarrierSet::barrier_set()->on_thread_attach(this); add_to_the_list(); ! // This is slightly odd in that NamedThread is a subclass, but // in fact name() is defined in Thread assert(this->name() != NULL, "thread name was not set before it was started"); this->set_native_thread_name(this->name()); } void NonJavaThread::post_run() { JFR_ONLY(Jfr::on_thread_exit(this);) // Clean up BarrierSet data before removing from list. BarrierSet::barrier_set()->on_thread_detach(this); remove_from_the_list(); // Ensure thread-local-storage is cleared before termination. Thread::clear_thread_current(); } // NamedThread -- non-JavaThread subclasses with multiple --- 1309,1341 ---- } } } void NonJavaThread::pre_run() { + { + SuspendibleThreadSetJoiner sts(!is_VM_thread() && // Drives the safepoint itself + !is_Worker_thread());// Might block if used at SP, syncs otherwise // Initialize BarrierSet-related data before adding to list. assert(BarrierSet::barrier_set() != NULL, "invariant"); BarrierSet::barrier_set()->on_thread_attach(this); add_to_the_list(); ! } // This is slightly odd in that NamedThread is a subclass, but // in fact name() is defined in Thread assert(this->name() != NULL, "thread name was not set before it was started"); this->set_native_thread_name(this->name()); } void NonJavaThread::post_run() { JFR_ONLY(Jfr::on_thread_exit(this);) + { + SuspendibleThreadSetJoiner sts(!is_VM_thread() && // Drives the safepoint itself + !is_Worker_thread());// Might block if used at SP, syncs otherwise // Clean up BarrierSet data before removing from list. BarrierSet::barrier_set()->on_thread_detach(this); remove_from_the_list(); + } // Ensure thread-local-storage is cleared before termination. Thread::clear_thread_current(); } // NamedThread -- non-JavaThread subclasses with multiple
< prev index next >