Embedded Multicore Building Blocks V1.0.0
|
Concept for thread synchronization. More...
Classes | |
class | embb::base::Spinlock |
Spinlock. More... | |
class | embb::base::Mutex |
Non-recursive, exclusive mutex. More... | |
class | embb::base::RecursiveMutex |
Recursive, exclusive mutex. More... | |
Concept for thread synchronization.
The mutex concept is used for thread synchronization and provides a lock. At any point in time, only one thread can exclusively hold the lock and the lock is held until the thread explicitly releases it.
Expression | Return type | Description |
---|---|---|
Mutex() | void | Constructs a mutex. |
m.TryLock() | bool | Tries to lock the mutex and immediately returns. Returns false , if the mutex could not be acquired (locked), otherwise true . |
m.Lock() | void | Locks the mutex. When the mutex is already locked, the current thread is blocked until the mutex is unlocked. |
m.Unlock() | void | Unlocks the mutex. |