|
FreeRTOS Addons
|
#include <condition_variable.hpp>
Public Member Functions | |
| ConditionVariable () | |
| void | Broadcast () |
| void | Signal () |
Friends | |
| class | Thread |
Class implementation of condition variable based on FreeRTOS C++ Wrapper classes.
A condition variable isn't really a variable. It's a list of threads.
The design here is that a Thread "waits", and a ConditionVariable "signals". This affects where the public interfaces reside.
| ConditionVariable::ConditionVariable | ( | ) |
Constructor to create a condition variable.
| void ConditionVariable::Broadcast | ( | ) |
Signal all threads waiting on this ConditionVariable.
| void ConditionVariable::Signal | ( | ) |
Signal a thread waiting on this ConditionVariable. Signaling is implemented as FIFO.
|
friend |
The Thread class and the ConditionVariable class are interdependent. If we allow the Thread class to access the internals of the ConditionVariable, we can reduce the public interface which is a good thing.