pub struct HazardBag {
head: AtomicPtr<HazardSlot>,
}
Expand description
Global bag (multiset) of hazards pointers.
HazardBag.head
and HazardSlot.next
form a grow-only list of all hazard slots. Slots are
never removed from this list. Instead, it gets deactivated and recycled for other Shield
s.
Fields§
§head: AtomicPtr<HazardSlot>
Implementations§
Source§impl HazardBag
impl HazardBag
Sourcefn acquire_slot(&self) -> &HazardSlot
fn acquire_slot(&self) -> &HazardSlot
Acquires a slot in the hazard set, either by recycling an inactive slot or allocating a new slot.
Sourcefn try_acquire_inactive(&self) -> Option<&HazardSlot>
fn try_acquire_inactive(&self) -> Option<&HazardSlot>
Find an inactive slot and activate it.
Sourcepub fn all_hazards(&self) -> HashSet<*mut ()>
pub fn all_hazards(&self) -> HashSet<*mut ()>
Returns all the hazards in the set.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HazardBag
impl RefUnwindSafe for HazardBag
impl Send for HazardBag
impl Sync for HazardBag
impl Unpin for HazardBag
impl UnwindSafe for HazardBag
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