static int
acquire (THREAD_ENTRY *th, int tran, const OID *oid,
const OID *class_oid, LOCK lock, int wait_msecs)
{
if (class_oid && !OID_IS_ROOTOID (class_oid))
lock_escalate_if_needed (th, class_entry, tran);
lk_Gl.m_obj_hash_table.find_or_insert (th, key, &res);
LOCK agg = res->total_holders_mode | res->total_waiters_mode;
if (!res->holder && !res->waiter) ...
else if (compatible (agg, lock)) ...
else ...
}
Three outcomes; the compatibility test reads both aggregates (holders | waiters) — that's the starvation guard.