MySQL 8.0.40
Source Code Documentation
|
Inlined implementation for os_event_*. More...
Functions | |
template<typename Condition > | |
static Wait_stats | os_event_wait_for (os_event_t &event, uint64_t spins_limit, std::chrono::microseconds timeout, Condition condition={}) |
Waits in loop until a provided condition is satisfied. More... | |
Inlined implementation for os_event_*.
|
inlinestatic |
Waits in loop until a provided condition is satisfied.
Combines usage of spin-delay and event.
When a provided number of spin iterations is reached, and the condition still has not returned true, waiting on a provided event starts.
Each wait uses a provided timeout. After each wake-up the condition is re-checked and function stops as soon as the condition returned true.
Every k-waits (ended on wake-up or timeout), the timeout is multiplied by two (but it's limited up to maximum value of 100ms).
[in,out] | event | event on which function may wait |
[in] | spins_limit | maximum spin iterations |
[in] | timeout | initial timeout value |
[in] | condition | returns true when condition is satisfied |