Struct std::sync::atomics::AtomicPtr[src]
pub struct AtomicPtr<T> {
// some fields omitted
}An unsafe atomic pointer. Only supports basic atomic operations
Methods
impl<T> AtomicPtr<T>
fn new<T>(p: *mut T) -> AtomicPtr<T>
Create a new AtomicPtr
fn load<T>(&self, order: Ordering) -> *mut T
Load the value
fn store<T>(&self, ptr: *mut T, order: Ordering)
Store the value
fn swap<T>(&self, ptr: *mut T, order: Ordering) -> *mut T
Store a value, returning the old value
fn compare_and_swap<T>(&self, old: *mut T, new: *mut T, order: Ordering) -> *mut T
If the current value is the same as expected, store a new value
Compare the current value with old; if they are the same then
replace the current value with new. Return the previous value.
If the return value is equal to old then the value was updated.