FreeRTOS C++ Wrappers
1.6.0
C++ interface to FreeRTOS
|
#include <condition_variable.hpp>
Public Member Functions | |
ConditionVariable () | |
void | Signal () |
void | Broadcast () |
Private Member Functions | |
void | AddToWaitList (Thread *thread) |
Private Attributes | |
MutexStandard | Lock |
std::list< Thread * > | WaitList |
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.
Definition at line 74 of file condition_variable.hpp.
ConditionVariable::ConditionVariable | ( | ) |
Constructor to create a condition variable.
Definition at line 52 of file ccondition_variable.cpp.
|
private |
Internal helper function to queue a Thread to this ConditionVariable's wait list.
Definition at line 58 of file ccondition_variable.cpp.
void ConditionVariable::Broadcast | ( | ) |
Signal all threads waiting on this ConditionVariable.
Definition at line 98 of file ccondition_variable.cpp.
void ConditionVariable::Signal | ( | ) |
Signal a thread waiting on this ConditionVariable. Signaling is implemented as FIFO.
Definition at line 77 of file ccondition_variable.cpp.
|
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.
Definition at line 130 of file condition_variable.hpp.
|
private |
Protect the internal ConditionVariable state.
Definition at line 111 of file condition_variable.hpp.
|
private |
Implementation of a wait list of Threads.
Definition at line 116 of file condition_variable.hpp.