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
#include <Mutex.h>
Public Member Functions | |
| Mutex () | |
| osStatus | lock (uint32_t millisec=osWaitForever) |
| bool | trylock () |
| osStatus | unlock () |
Detailed Description
The Mutex class is used to synchronise the execution of threads. This is for example used to protect access to a shared resource.
Definition at line 13 of file Mutex.h.
Constructor & Destructor Documentation
Member Function Documentation
| osStatus lock | ( | uint32_t | millisec = osWaitForever ) |
Wait until a Mutex becomes available.
- Parameters:
-
millisec timeout value or 0 in case of no time-out. (default: osWaitForever)
- Returns:
- status code that indicates the execution status of the function.
| bool trylock | ( | ) |
Try to lock the mutex, and return immediately
- Returns:
- true if the mutex was acquired, false otherwise.
| osStatus unlock | ( | ) |
Unlock the mutex that has previously been locked by the same thread
- Returns:
- status code that indicates the execution status of the function.
Generated on Wed Jul 13 2022 00:51:02 by
1.7.2