pub struct MwCas<'g> { /* private fields */ }
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

Create new MwCAS.

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 from target pointer at some point in time, using HeapPointer.read() method.
  • new_val will be installed to target on MwCas success. If MwCas will fail, then new_val will be dropped.

Add compare-exchange operation to MwCAS for simple u64.

  • target struct contains u64 which should be replaced by MwCas.
  • orig_val is expected value of target during CAS.
  • new_val will be installed to target on MwCas success.

Execute all registered CAS operations and return result status.

guard is used for reclamation of memory used by previous values which were replaced during MwCas by new one.

Trait Implementations

Returns the “default value” for a type. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.