pub type TimerService = GenericTimerService<RawMutex>;
Expand description
A GenericTimerService
implementation backed by parking_lot
.
Aliased Type§
struct TimerService { /* private fields */ }
Implementations
source§impl<MutexType: RawMutex> GenericTimerService<MutexType>
impl<MutexType: RawMutex> GenericTimerService<MutexType>
sourcepub fn new(clock: &'static dyn Clock) -> GenericTimerService<MutexType>
pub fn new(clock: &'static dyn Clock) -> GenericTimerService<MutexType>
sourcepub fn next_expiration(&self) -> Option<u64>
pub fn next_expiration(&self) -> Option<u64>
Returns a timestamp when the next timer expires.
For thread-safe timers, the returned value is not precise and subject to race-conditions, since other threads can add timer in the meantime.
Therefore adding any timer to the GenericTimerService
should also
make sure to wake up the executor which polls for timeouts, in order to
let it capture the latest change.
sourcepub fn check_expirations(&self)
pub fn check_expirations(&self)
Checks whether any of the attached TimerFuture
s has expired.
In this case the associated task is woken up.