use core::sync::atomic::Ordering;
pub trait BaseArrayRef {}
pub trait ArrayRef: BaseArrayRef + Clone {
fn clone(ptr: &Self) -> Self {
ptr.clone()
}
}
pub trait AtomicArrayRef: BaseArrayRef + Sized {
fn as_ref(&self) -> usize;
fn compare_and_swap(
&self,
current: usize,
new: Self,
order: Ordering,
) -> Result<usize, (Self, usize)>;
fn compare_exchange(
&self,
current: usize,
new: Self,
success: Ordering,
failure: Ordering,
) -> Result<usize, (Self, usize)>;
fn compare_exchange_weak(
&self,
current: usize,
new: Self,
success: Ordering,
failure: Ordering,
) -> Result<usize, (Self, usize)>;
fn swap(&self, ptr: Self, order: Ordering) -> Self;
}