Struct hazard::Pointers [−][src]
#[repr(C)]pub struct Pointers<T, M> where
M: Memory, { /* fields omitted */ }
A collection of hazardous pointers.
Methods
impl<T, M> Pointers<T, M> where
M: Memory,
[src]
impl<T, M> Pointers<T, M> where
M: Memory,
pub fn new(memory: M, threads: usize, domains: usize, threshold: usize) -> Self
[src]
pub fn new(memory: M, threads: usize, domains: usize, threshold: usize) -> Self
Constructs a new Pointers
.
The maximum number of threads is specified by threads
and the maximum number of hazardous
pointers per thread is specified by domains
.
The maximum size lists of retired pointers can grow to is specified by threshold
. Once a
list of retired pointers reaches this limit, any pointers that are no longer hazardous are
removed from the list and the memory they refer to is deallocated.
pub fn mark(
&self,
thread: usize,
domain: usize,
pointer: &AtomicPtr<T>
) -> *mut T
[src]
pub fn mark(
&self,
thread: usize,
domain: usize,
pointer: &AtomicPtr<T>
) -> *mut T
Sets the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: lock-free.
pub fn mark_ptr(&self, thread: usize, domain: usize, pointer: *mut T) -> *mut T
[src]
pub fn mark_ptr(&self, thread: usize, domain: usize, pointer: *mut T) -> *mut T
Sets the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: wait-free population oblivious.
pub fn clear(&self, thread: usize, domain: usize)
[src]
pub fn clear(&self, thread: usize, domain: usize)
Clears the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: wait-free population oblivious.
pub fn hazardous(&self, pointer: *mut T) -> bool
[src]
pub fn hazardous(&self, pointer: *mut T) -> bool
Returns whether the supplied pointer is considered hazardous.
Forward progress guarantee: wait-free bounded (threads * domains
).
pub fn retire(&self, thread: usize, pointer: *mut T)
[src]
pub fn retire(&self, thread: usize, pointer: *mut T)
Retires the supplied pointer using the supplied thread.
Forward progress guarantee: wait-free bounded (threads * threads
).
Trait Implementations
impl<T, M> Drop for Pointers<T, M> where
M: Memory,
[src]
impl<T, M> Drop for Pointers<T, M> where
M: Memory,
impl<T, M> Debug for Pointers<T, M> where
M: Memory,
[src]
impl<T, M> Debug for Pointers<T, M> where
M: Memory,