CppELib 1.7.0
Loading...
Searching...
No Matches
StdCppOSWrapper::StdCppMutex Class Reference

Public Member Functions

 StdCppMutex ()
 
 ~StdCppMutex ()
 
OSWrapper::Error lock ()
 Block the current thread until locks this mutex.
 
OSWrapper::Error tryLock ()
 Try to lock this mutex without blocking.
 
OSWrapper::Error timedLock (OSWrapper::Timeout tmout)
 Block the current thread until locks this mutex but only within the limited time.
 
OSWrapper::Error unlock ()
 Unlock this mutex that the current thread locks.
 

Additional Inherited Members

- Static Public Member Functions inherited from OSWrapper::Mutex
static Mutexcreate ()
 Create a Mutex object.
 
static Mutexcreate (int priorityCeiling)
 Create a Mutex object with priority ceiling protocol.
 
static void destroy (Mutex *m)
 Destroy a Mutex object.
 
- Protected Member Functions inherited from OSWrapper::Mutex
virtual ~Mutex ()
 

Constructor & Destructor Documentation

◆ StdCppMutex()

StdCppOSWrapper::StdCppMutex::StdCppMutex ( )
inline

◆ ~StdCppMutex()

StdCppOSWrapper::StdCppMutex::~StdCppMutex ( )
inline

Member Function Documentation

◆ lock()

OSWrapper::Error StdCppOSWrapper::StdCppMutex::lock ( )
inlinevirtual

Block the current thread until locks this mutex.

Return values
OKSuccess. The current thread locked this mutex
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
Same as timedLock(Timeout::FOREVER)

Implements OSWrapper::Mutex.

◆ timedLock()

OSWrapper::Error StdCppOSWrapper::StdCppMutex::timedLock ( OSWrapper::Timeout  tmout)
inlinevirtual

Block the current thread until locks this mutex but only within the limited time.

Parameters
tmoutThe limited time
Return values
OKSuccess. The current thread locked this mutex
TimedOutThe limited time was elapsed
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
If tmout is Timeout::POLLING then this method tries to lock this mutex without blocking.
If tmout is Timeout::FOREVER then this method waits forever until locks this mutex.

Implements OSWrapper::Mutex.

◆ tryLock()

OSWrapper::Error StdCppOSWrapper::StdCppMutex::tryLock ( )
inlinevirtual

Try to lock this mutex without blocking.

Return values
OKSuccess. The current thread locked this mutex
TimedOutFailed. Other thread already locked this mutex
Note
Same as timedLock(Timeout::POLLING)

Implements OSWrapper::Mutex.

◆ unlock()

OSWrapper::Error StdCppOSWrapper::StdCppMutex::unlock ( )
inlinevirtual

Unlock this mutex that the current thread locks.

Return values
OKSuccess. The current thread unlocked this mutex
NotLockedThe current thread has not locked this mutex

Implements OSWrapper::Mutex.


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