Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Mutex Class Reference
[Rtos]
The Mutex class is used to synchronize the execution of threads. More...
#include <Mutex.h>
Inherits NonCopyable< Mutex >.
Public Member Functions | |
Mutex () | |
Create and Initialize a Mutex object. | |
Mutex (const char *name) | |
Create and Initialize a Mutex object. | |
osStatus | lock (uint32_t millisec=osWaitForever) |
Wait until a Mutex becomes available. | |
bool | trylock () |
Try to lock the mutex, and return immediately. | |
osStatus | unlock () |
Unlock the mutex that has previously been locked by the same thread. |
Detailed Description
The Mutex class is used to synchronize the execution of threads.
This is for example used to protect access to a shared resource.
- Note:
- Memory considerations: The mutex control structures will be created on 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 43 of file Mutex.h.
Constructor & Destructor Documentation
Generated on Tue Jul 12 2022 20:03:34 by
