# HG changeset patch # User rkennke # Date 1553019479 -3600 # Tue Mar 19 19:17:59 2019 +0100 # Node ID acc6e0a687c4c4e3d25fac7f179b9cdda5fe4d88 # Parent 7a9a828195c769181646a6e611eea32d46763fb2 8221086: Shenandoah-specific workaround for JDK-8220671 diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp @@ -332,6 +332,9 @@ void ShenandoahBarrierSet::on_thread_attach(Thread *thread) { assert(!thread->is_Java_thread() || !SafepointSynchronize::is_at_safepoint(), "We should not be at a safepoint"); + SuspendibleThreadSetJoiner sts(!thread->is_Java_thread() && // Already syncs with safepoints + !thread->is_VM_thread() && // Drives the safepoint itself + !thread->is_Worker_thread());// Might block if used at SP, syncs otherwise SATBMarkQueue& queue = ShenandoahThreadLocalData::satb_mark_queue(thread); assert(!queue.is_active(), "SATB queue should not be active"); assert( queue.is_empty(), "SATB queue should be empty"); @@ -343,6 +346,9 @@ } void ShenandoahBarrierSet::on_thread_detach(Thread *thread) { + SuspendibleThreadSetJoiner sts(!thread->is_Java_thread() && // Already syncs with safepoints + !thread->is_VM_thread() && // Drives the safepoint itself + !thread->is_Worker_thread());// Might block if used at SP, syncs otherwise SATBMarkQueue& queue = ShenandoahThreadLocalData::satb_mark_queue(thread); queue.flush(); if (thread->is_Java_thread()) {