Add constant for control lock rank

This commit is contained in:
William Kemper 2026-01-20 12:35:45 -08:00
parent 688c2f8cca
commit e3086a8517
3 changed files with 6 additions and 5 deletions

View File

@ -44,7 +44,7 @@ ShenandoahControlThread::ShenandoahControlThread() :
ShenandoahController(),
_requested_gc_cause(GCCause::_no_gc),
_degen_point(ShenandoahGC::_degenerated_outside_cycle),
_control_lock(Mutex::nosafepoint - 3, "ShenandoahControl_lock", true) {
_control_lock(CONTROL_LOCK_RANK, "ShenandoahControl_lock", true) {
set_name("Shenandoah Control Thread");
create_and_start();
}

View File

@ -42,7 +42,8 @@ private:
shenandoah_padding(1);
protected:
const Mutex::Rank LOCK_RANK = Mutex::safepoint - 3;
const Mutex::Rank WAITERS_LOCK_RANK = Mutex::safepoint - 5;
const Mutex::Rank CONTROL_LOCK_RANK = Mutex::nosafepoint - 2;
// While we could have a single lock for these, it may risk unblocking
// GC waiters when alloc failure GC cycle finishes. We want instead
@ -56,8 +57,8 @@ protected:
public:
ShenandoahController():
_gc_id(0),
_alloc_failure_waiters_lock(LOCK_RANK, "ShenandoahAllocFailureWaiters_lock", true),
_gc_waiters_lock(LOCK_RANK, "ShenandoahGCWaiters_lock", true)
_alloc_failure_waiters_lock(WAITERS_LOCK_RANK, "ShenandoahAllocFailureWaiters_lock", true),
_gc_waiters_lock(WAITERS_LOCK_RANK, "ShenandoahGCWaiters_lock", true)
{ }
// Request a collection cycle. This handles "explicit" gc requests

View File

@ -47,7 +47,7 @@
#include "utilities/events.hpp"
ShenandoahGenerationalControlThread::ShenandoahGenerationalControlThread() :
_control_lock(Mutex::nosafepoint - 3, "ShenandoahGCRequest_lock", true),
_control_lock(CONTROL_LOCK_RANK, "ShenandoahGCRequest_lock", true),
_requested_gc_cause(GCCause::_no_gc),
_requested_generation(nullptr),
_gc_mode(none),