RoundRobinQuantum class is a quantum of time for round-robin scheduling.
More...
#include "distortos/internal/scheduler/RoundRobinQuantum.hpp"
RoundRobinQuantum class is a quantum of time for round-robin scheduling.
◆ Duration
duration type used for quantum
◆ Representation
◆ RoundRobinQuantum()
constexpr distortos::internal::RoundRobinQuantum::RoundRobinQuantum |
( |
| ) |
|
|
inline |
◆ decrement()
void distortos::internal::RoundRobinQuantum::decrement |
( |
| ) |
|
|
inline |
Decrements round-robin's quantum.
This function should be called from tick interrupt for the currently running thread. Underflow of quantum after this decrement is not possible.
- Note
- this function must be called with enabled interrupt masking
◆ get()
Duration distortos::internal::RoundRobinQuantum::get |
( |
| ) |
const |
|
inline |
Gets current value of round-robin's quantum.
- Returns
- current value of round-robin's quantum of the thread
◆ getInitial()
static constexpr Duration distortos::internal::RoundRobinQuantum::getInitial |
( |
| ) |
|
|
inlinestatic |
- Returns
- initial value for round-robin quantum
◆ isZero()
bool distortos::internal::RoundRobinQuantum::isZero |
( |
| ) |
const |
|
inline |
Convenience function to test whether the quantum is already at 0.
- Returns
- true if quantum is zero, false otherwise
◆ reset()
void distortos::internal::RoundRobinQuantum::reset |
( |
| ) |
|
|
inline |
Resets value of round-robin's quantum.
This function should be called from context switcher after selecting new task that will be run.
◆ quantum_
Duration distortos::internal::RoundRobinQuantum::quantum_ |
|
private |
◆ quantumRawInitializer_
constexpr auto distortos::internal::RoundRobinQuantum::quantumRawInitializer_ |
|
staticprivate |
Initial value:= (DISTORTOS_TICK_FREQUENCY + DISTORTOS_ROUND_ROBIN_FREQUENCY / 2) /
DISTORTOS_ROUND_ROBIN_FREQUENCY
raw initializer value for round-robin quantum, calculated with rounding to nearest
The documentation for this class was generated from the following file: