优化锁系统

This commit is contained in:
mnjnhuang 2025-11-18 16:47:44 +08:00
parent 4c2b7203ad
commit dc0d41f477

View File

@ -12,7 +12,7 @@ public class EventSvcLock
{ {
if (!_exclusive_lock_queue.Add(lock_name)) if (!_exclusive_lock_queue.Add(lock_name))
{ {
if (GetNeedDebugLog()) Debug.LogWarning($"拒绝加锁: [{lock_name}]"); Debug.LogWarning($"拒绝加锁: [{lock_name}]");
return false; return false;
} }
@ -30,7 +30,7 @@ public class EventSvcLock
public bool LOCK_GET(EVENT_EXCLUSIVE_LOCK lock_name) public bool LOCK_GET(EVENT_EXCLUSIVE_LOCK lock_name)
{ {
if (!_exclusive_lock_queue.Contains(lock_name)) return false; if (!_exclusive_lock_queue.Contains(lock_name)) return false;
if (GetNeedDebugLog()) Debug.LogWarning($"状态已被锁定: [{lock_name}]"); Debug.LogWarning($"状态已被锁定: [{lock_name}]");
return true; return true;
} }
} }