pub struct Backoff {
step: Cell<u32>,
}
Expand description
Performs quadratic backoff in spin loops.
Fields§
§step: Cell<u32>
Implementations§
source§impl Backoff
impl Backoff
sourcepub fn spin_light(&self)
pub fn spin_light(&self)
Backs off using lightweight spinning.
This method should be used for retrying an operation because another thread made progress. i.e. on CAS failure.
sourcepub fn spin_heavy(&self)
pub fn spin_heavy(&self)
Backs off using heavyweight spinning.
This method should be used in blocking loops where parking the thread is not an option.
Auto Trait Implementations§
impl !RefUnwindSafe for Backoff
impl Send for Backoff
impl !Sync for Backoff
impl Unpin for Backoff
impl UnwindSafe for Backoff
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more