tryLock method

bool tryLock()

Acquires the mutex immediately if not locked; returns false if already held. Audited: 2026-06-12 11:26 EDT

Implementation

bool tryLock() {
  if (_isLocked) return false;
  _isLocked = true;
  return true;
}