Production-grade wrapper around ThreadX Semaphore to mimic std::condition_variable.
More...
#include <ThreadXConditionVariable.h>
Production-grade wrapper around ThreadX Semaphore to mimic std::condition_variable.
- Uses a Counting Semaphore (initialized to 0).
- ISR-safe notification logic (tx_semaphore_put).
- Robust tick overflow handling using elapsed time subtraction.
- Note
- Limitation: Unlike std::cv, a semaphore retains its signal state. If notify() occurs before wait(), the wait will effectively "fall through".
◆ ThreadXConditionVariable() [1/2]
| dmq::ThreadXConditionVariable::ThreadXConditionVariable |
( |
| ) |
|
|
inline |
◆ ~ThreadXConditionVariable()
| dmq::ThreadXConditionVariable::~ThreadXConditionVariable |
( |
| ) |
|
|
inline |
◆ ThreadXConditionVariable() [2/2]
◆ notify_one()
| void dmq::ThreadXConditionVariable::notify_one |
( |
| ) |
|
|
inlinenoexcept |
Wake up one waiting thread (ISR Safe)
◆ operator=()
◆ wait()
template<typename Lock , typename Predicate >
| void dmq::ThreadXConditionVariable::wait |
( |
Lock & | lock, |
|
|
Predicate | pred ) |
|
inline |
Wait indefinitely until predicate is true.
◆ wait_for()
template<typename Lock , typename Predicate >
| bool dmq::ThreadXConditionVariable::wait_for |
( |
Lock & | lock, |
|
|
std::chrono::milliseconds | timeout, |
|
|
Predicate | pred ) |
|
inline |
Wait until predicate is true or timeout expires.
The documentation for this class was generated from the following file: