Extends "abstract template type" TCondition. This implementation constitutes the simplest possible derivate, by
- holding just a boolean member, and
- by providing a similar generic interface.
- See also
- Chapter A.5 Collecting Caller Information of the General Programmer's Manual.
Definition at line 347 of file condition.hpp.
#include <condition.hpp>
|
| bool | notified = false |
| | Boolean member which records notifications. Defaults to not-notified.
|
| std::condition_variable | conditionVariable |
| | The condition variable used for blocking and notification.
|
| DbgConditionAsserter | Dbg |
| | The debug tool instance.
|
| std::mutex | mutex |
| | The mutex used for locking this instance.
|
◆ notified
| bool alib::threads::Event::notified = false |
|
protected |
Boolean member which records notifications. Defaults to not-notified.
Definition at line 355 of file condition.hpp.
◆ Event()
| alib::threads::Event::Event |
( |
const character * | dbgName | ) |
|
|
inline |
Defaulted default constructor.
- Parameters
-
| dbgName | A name for the condition. Only available with debug-compilations. |
Definition at line 373 of file condition.hpp.
◆ isConditionMet()
| bool alib::threads::Event::isConditionMet |
( |
| ) |
|
|
inlineprotected |
In general, derivates of TCondition have to return true if the former reason for blocking a thread is now fulfilled.
- Returns
- This implementation returns the value of field member notified.
Definition at line 361 of file condition.hpp.
◆ Reset()
Resets the condition (flag becomes false). No notification is sent.
- Debug Parameter:
- Pass macro ALIB_CALLER_PRUNED with invocations.
Definition at line 399 of file condition.hpp.
◆ ResetAndWait() [1/4]
Clears the condition first and then waits (for an unlimited time). This provides edge-triggered semantics comparable to the previous implementation of Wait.
- Debug Parameter:
- Pass macro ALIB_CALLER_PRUNED with invocations.
Definition at line 424 of file condition.hpp.
◆ ResetAndWait() [2/4]
| void alib::threads::Event::ResetAndWait |
( |
const Ticks & | wakeUpTime, |
|
|
const CallerInfo & | ci ) |
|
inline |
Clears the condition first and then waits until a given point in time.
- Parameters
-
| wakeUpTime | The point in time to wake up, even if not notified. |
| ci | Caller information. Use the macro ALIB_COMMA_CALLER_PRUNED with invocations. |
Definition at line 521 of file condition.hpp.
◆ ResetAndWait() [3/4]
| void alib::threads::Event::ResetAndWait |
( |
const Ticks::Duration & | maxWaitTimeSpan, |
|
|
const CallerInfo & | ci ) |
|
inline |
Clears the condition first and then waits for up to a given duration.
- Parameters
-
Definition at line 489 of file condition.hpp.
◆ ResetAndWait() [4/4]
| void alib::threads::Event::ResetAndWait |
( |
const Ticks::Duration::TDuration & | maxWaitTimeSpan, |
|
|
const CallerInfo & | ci ) |
|
inline |
Clears the condition first and then waits for up to a given duration.
- Parameters
-
Definition at line 453 of file condition.hpp.
◆ Set()
Sets the condition (flag becomes true) and wakes up the next sleeping thread.
- Debug Parameter:
- Pass macro ALIB_CALLER_PRUNED with invocations.
Definition at line 381 of file condition.hpp.
◆ SetAll()
Sets the condition (flag becomes true) and wakes up all sleeping threads.
- Debug Parameter:
- Pass macro ALIB_CALLER_PRUNED with invocations.
Definition at line 390 of file condition.hpp.
◆ Wait() [1/4]
Waits until the condition is set (for an unlimited time). This method does not modify the condition state.
- Debug Parameter:
- Pass macro ALIB_CALLER_PRUNED with invocations.
Definition at line 409 of file condition.hpp.
◆ Wait() [2/4]
| void alib::threads::Event::Wait |
( |
const Ticks & | wakeUpTime, |
|
|
const CallerInfo & | ci ) |
|
inline |
Waits for notification, but only until a given point in time.
Before invoking this method, this object has to be acquired. After the wake-up call, the internal mutex is (again) acquired and thus has to be released later.
- Parameters
-
| wakeUpTime | The point in time to wake up, even if not notified. |
| ci | Caller information. Use the macro ALIB_COMMA_CALLER_PRUNED with invocations. Waits until the condition is set, but only until a given point in time. This method does not modify the condition state. |
Definition at line 511 of file condition.hpp.
◆ Wait() [3/4]
| void alib::threads::Event::Wait |
( |
const Ticks::Duration & | maxWaitTimeSpan, |
|
|
const CallerInfo & | ci ) |
|
inline |
Waits for notification but only for a given duration.
Before invoking this method, this object has to be acquired. After the wake-up call, the internal mutex is (again) acquired and thus has to be released later.
- Parameters
-
Definition at line 482 of file condition.hpp.
◆ Wait() [4/4]
| void alib::threads::Event::Wait |
( |
const Ticks::Duration::TDuration & | maxWaitTimeSpan, |
|
|
const CallerInfo & | ci ) |
|
inline |
The documentation for this class was generated from the following file: