|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Interface for mutex synchronization primitive. More...
#include <stk_common.h>
Classes | |
| class | ScopedLock |
| Locks bound mutex within a scope of execution. Ensures the mutex is always unlocked when leaving the scope, even when exceptions are thrown. More... | |
Public Member Functions | |
| virtual void | Lock ()=0 |
| Lock the mutex. | |
| virtual void | Unlock ()=0 |
| Unlock the mutex. | |
| virtual bool | TryLock ()=0 |
| Try locking the mutex in a single non-blocking attempt. | |
Protected Member Functions | |
| ~IMutex ()=default | |
| Destructor. | |
Interface for mutex synchronization primitive.
Definition at line 816 of file stk_common.h.
|
protecteddefault |
Destructor.
|
pure virtual |
Lock the mutex.
Implemented in stk::sync::FastMutex, stk::sync::Mutex, stk::sync::RWMutex, stk::sync::ScopedCriticalSection, and stk::sync::SpinLock.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::OnTaskWait().
|
pure virtual |
Try locking the mutex in a single non-blocking attempt.
true if the lock was acquired; false if it was already held by another thread/core. Implemented in stk::sync::FastMutex, stk::sync::Mutex, stk::sync::RWMutex, stk::sync::ScopedCriticalSection, and stk::sync::SpinLock.
|
pure virtual |
Unlock the mutex.
Implemented in stk::sync::FastMutex, stk::sync::Mutex, stk::sync::RWMutex, stk::sync::ScopedCriticalSection, and stk::sync::SpinLock.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::OnTaskWait().