|
| Mutex () |
| Create and Initialize a Mutex object.
|
|
| Mutex (const char *name) |
| Create and Initialize a Mutex object.
|
|
void | lock () |
| Wait until a Mutex becomes available.
|
|
bool | trylock () |
| Try to lock the mutex, and return immediately.
|
|
bool | trylock_for (uint32_t millisec) |
| Try to lock the mutex for a specified time.
|
|
bool | trylock_for (Kernel::Clock::duration_u32 rel_time) |
| Try to lock the mutex for a specified time.
|
|
bool | trylock_until (uint64_t millisec) |
| Try to lock the mutex until specified time.
|
|
bool | trylock_until (Kernel::Clock::time_point abs_time) |
| Try to lock the mutex until specified time.
|
|
void | unlock () |
| Unlock the mutex that has previously been locked by the same thread.
|
|
osThreadId_t | get_owner () |
| Get the owner the this mutex.
|
|
| ~Mutex () |
| Mutex destructor.
|
|
The Mutex class is used to synchronize the execution of threads.
This is, for example, used to protect access to a shared resource.
In bare-metal builds, the Mutex class is a dummy, so lock() and unlock() are no-ops.
- Note
- You cannot use member functions of this class in ISR context. If you require Mutex functionality within ISR handler, consider using Semaphore.
-
Memory considerations: The mutex control structures are created on the current thread's stack, both for the Mbed OS and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
Definition at line 70 of file Mutex.h.