Struct mwcas::MwCas [−][src]
pub struct MwCas<'g> { /* fields omitted */ }
Expand description
Multi-word CAS structure.
MwCas
contains multi-word CAS state, including pointers which should be changed,
original and new pointer values.
MwCas
provides compare and exchange
operations to register CAS operations on pointers.
When all compare and exchange
operations registered, caller should execute exec
method to
actually perform multi-word CAS.
Implementations
pub fn compare_exchange<T>(
&mut self,
target: &'g HeapPointer<T>,
orig_val: &'g T,
new_val: T
)
pub fn compare_exchange<T>(
&mut self,
target: &'g HeapPointer<T>,
orig_val: &'g T,
new_val: T
)
Add compare-exchange operation to MwCAS for heap allocated data.
target
points to heap allocated data which should be replaced by new value.orig_val
is value is fromtarget
pointer at some point in time, usingHeapPointer.read()
method.new_val
will be installed totarget
onMwCas
success. IfMwCas
will fail, thennew_val
will be dropped.
Add compare-exchange operation to MwCAS for simple u64.
target
struct contains u64 which should be replaced byMwCas
.orig_val
is expected value oftarget
during CAS.new_val
will be installed totarget
onMwCas
success.
Trait Implementations
Auto Trait Implementations
impl<'g> !RefUnwindSafe for MwCas<'g>
impl<'g> !UnwindSafe for MwCas<'g>