COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Semaphore.hh>
Public Member Functions | |
Semaphore (uint8_t count=1) | |
void | wait (uint8_t count=1) |
void | signal (uint8_t count=1, bool flag=true) |
The Cosa Nucleo Semaphore; counting synchronization primitive.
Definition at line 32 of file Semaphore.hh.
|
inline |
Construct and initiate semaphore with given counter.
[in] | count | initial semaphore value (Default mutex, 1). |
Definition at line 38 of file Semaphore.hh.
void Semaphore::signal | ( | uint8_t | count = 1 , |
bool | flag = true |
||
) |
Signal release of given count. Waiting thread is resumed after running thread has completed/yield.
[in] | count | released (Default mutex, 1). |
[in] | flag | resume waiting thread (Default true). |
Definition at line 40 of file Semaphore.cpp.
void Semaphore::wait | ( | uint8_t | count = 1 | ) |
Wait for required count. Threads are queued until count is available.
[in] | count | requested count (Default mutex, 1). |
Definition at line 27 of file Semaphore.cpp.