tryLock method
Acquires the mutex immediately if not locked; returns false if already held.
Implementation
bool tryLock() {
if (_isLocked) return false;
_isLocked = true;
return true;
}
Acquires the mutex immediately if not locked; returns false if already held.
bool tryLock() {
if (_isLocked) return false;
_isLocked = true;
return true;
}