FreeRTOS Addons
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
cpp_freertos::ConditionVariable Class Reference

#include <condition_variable.hpp>

Public Member Functions

 ConditionVariable ()
 
void Broadcast ()
 
void Signal ()
 

Friends

class Thread
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConditionVariable()

ConditionVariable::ConditionVariable ( )

Constructor to create a condition variable.

Member Function Documentation

◆ Broadcast()

void ConditionVariable::Broadcast ( )

Signal all threads waiting on this ConditionVariable.

◆ Signal()

void ConditionVariable::Signal ( )

Signal a thread waiting on this ConditionVariable. Signaling is implemented as FIFO.

Friends And Related Function Documentation

◆ Thread

friend class Thread
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.


The documentation for this class was generated from the following files: