8383847: Shenandoah: gc/TestJNIWeak/TestJNIWeak.java times out intermittently

Reviewed-by: wkemper, ysr, kdnilsen
This commit is contained in:
Patrick Fontanilla 2026-05-18 17:05:05 +00:00 committed by William Kemper
parent b74ab79cdd
commit a73eca9e8b

View File

@ -68,7 +68,7 @@ void ShenandoahControlThread::run_service() {
// Figure out if we have pending requests.
const bool alloc_failure_pending = ShenandoahCollectorPolicy::is_allocation_failure(cancelled_cause);
const bool is_gc_requested = _gc_requested.is_set();
const bool is_gc_requested = _gc_requested.try_unset();
const GCCause::Cause requested_gc_cause = _requested_gc_cause;
// Choose which GC mode to run in. The block below should select a single mode.
@ -406,7 +406,6 @@ void ShenandoahControlThread::handle_requested_gc(GCCause::Cause cause) {
}
void ShenandoahControlThread::notify_gc_waiters() {
_gc_requested.unset();
MonitorLocker ml(&_gc_waiters_lock);
ml.notify_all();
}