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.
Semaphore Class Reference
#include <Semaphore.h>
Public Member Functions | |
| Semaphore (int32_t count) | |
| int32_t | wait (uint32_t millisec=osWaitForever) |
| osStatus | release (void) |
Detailed Description
The Semaphore class is used to manage and protect access to a set of shared resources.
Definition at line 11 of file Semaphore.h.
Constructor & Destructor Documentation
| Semaphore | ( | int32_t | count ) |
Create and Initialize a Semaphore object used for managing resources.
- Parameters:
-
number of available resources; maximum index value is (count-1).
Member Function Documentation
| osStatus release | ( | void | ) |
Release a Semaphore resource that was obtain with Semaphore::wait.
- Returns:
- status code that indicates the execution status of the function.
| int32_t wait | ( | uint32_t | millisec = osWaitForever ) |
Wait until a Semaphore resource becomes available.
- Parameters:
-
millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
- Returns:
- number of available tokens, or -1 in case of incorrect parameters
Generated on Tue Jul 12 2022 17:50:57 by
1.7.2