pub struct Shield {
slot: NonNull<HazardSlot>,
}
Expand description
Represents the ownership of a hazard pointer slot.
Fields§
§slot: NonNull<HazardSlot>
Implementations§
Source§impl Shield
impl Shield
Sourcepub fn validate<T>(pointer: *mut T, src: &AtomicPtr<T>) -> Result<(), *mut T>
pub fn validate<T>(pointer: *mut T, src: &AtomicPtr<T>) -> Result<(), *mut T>
Check if src
still points to pointer
. If not, returns the current value.
For a pointer p
, if “src
still pointing to pointer
” implies that p
is not retired,
then Ok(())
means that shields set to p
are validated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shield
impl RefUnwindSafe for Shield
impl !Send for Shield
impl !Sync for Shield
impl Unpin for Shield
impl UnwindSafe for Shield
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