Struct nolock::hazard_ptr::Guard [−][src]
pub struct Guard<T> { /* fields omitted */ }
Expand description
A Guard protects a single Memory address and provides secure access to it, as long as the Guard is not dropped
Implementations
Loads the most recent Ptr-Value from the given AtomicPtr and updates the current Guard to now protect this new Ptr.
Usage
This should be used when you already have Guard, but no longer need the original Guard/Value and now need to protect another new Memory- Location, as this method reuses an already owned Hazard-Pointer/Guard and therefore does not need to acquire a Hazard-Pointer beforehand.
This is especially useful when iterating a Datastruture, as you often only have one Node you are currently processing and then move on to another one.