DoxigAlpha

Deadline

Deadline is used to wait efficiently for a pointer's value to change using Futex and a fixed timeout.

Futex's timedWait() api uses a relative duration which suffers from over-waiting when used in a loop which is often required due to the possibility of spurious wakeups.

Deadline instead converts the relative timeout to an absolute one so that multiple calls to Futex timedWait() can block for and report more accurate error.Timeouts.

Fields of this type

Fields

#
timeout:?u64
started:std.time.Timer

Create the deadline to expire after the given amount of time in nanoseconds passes.

Functions

#
init
Create the deadline to expire after the given amount of time in nanoseconds passes.
wait
Wait until either: