pub struct Ready {
ready: AtomicU8,
}Expand description
A synchronization primitive that can be used to block a thread until a value is ready. The procedure is as follows:
- The Caller calls step(NOT_READY) to indicate that it is about to start the initialization process.
- The Caller initializes the value.
- The Caller calls step(IN_TRANSIT) to indicate that the value is ready. If step 1 fails, the value is already being initialized and the Caller must wait until is() returns true.
Fields§
§ready: AtomicU8Implementations§
Auto Trait Implementations§
impl !Freeze for Ready
impl RefUnwindSafe for Ready
impl Send for Ready
impl Sync for Ready
impl Unpin for Ready
impl UnwindSafe for Ready
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