INOS
CINOSTryLock Class Reference

Public Member Functions

 CINOSTryLock (CINOSMutex &aMutex)
 Try to request the given mutex. IOW: Locks if mutex is not held by another task, but does nothing otherwise.
 
 ~CINOSTryLock ()
 Release the owned mutex.
 
void EarlyUnlock ()
 Release the owned mutex. Can be used to release the mutex before the destructor is called. Note that it is safe to call this function even if the lock was never gotten in the first place. It's also ok to call this function multiple times.
 
 operator bool () const
 

Protected Attributes

CINOSMutexm_pMutex
 pointer to the owned mutex
 

Constructor & Destructor Documentation

◆ CINOSTryLock()

CINOSTryLock::CINOSTryLock ( CINOSMutex aMutex)
inlineexplicit

Try to request the given mutex. IOW: Locks if mutex is not held by another task, but does nothing otherwise.

Parameters
aMutexMutex to be try-requested

Member Function Documentation

◆ operator bool()

CINOSTryLock::operator bool ( ) const
inline
Returns
true if the lock (aka mutex) is currently requested. IOW: If no other task held the lock when this object's CTOR was executed and EarlyUnlock was not yet called. false otherwise.

The documentation for this class was generated from the following file: