DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="3.1.1" />

 AtomicUInt32

public static class AtomicUInt32
Various atomic operations for UInt32 data type accessible as extension methods.
public static uint AccumulateAndGet(this ref uint value, uint x, Func<uint, uint, uint> accumulator)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.

public static uint AccumulateAndGet(this ref uint value, uint x, method accumulator)

public static uint AccumulateAndGet(this uint[] array, long index, uint x, Func<uint, uint, uint> accumulator)

Atomically updates the array element with the results of applying the given function to the array element and given values, returning the updated value.

public static uint AccumulateAndGet(this uint[] array, long index, uint x, method accumulator)

public static uint Add(this ref uint value, uint operand)

Adds two 32-bit integers and replaces referenced integer with the sum, as an atomic operation.

public static uint Add(this uint[] array, long index, uint operand)

Adds two 32-bit integers and replaces array element with the sum, as an atomic operation.

public static bool CompareAndSet(this ref uint value, uint expected, uint update)

Atomically sets the referenced value to the given updated value if the current value == the expected value.

public static bool CompareAndSet(this uint[] array, long index, uint expected, uint update)

Atomically sets array element to the given updated value if the array element == the expected value.

public static uint CompareExchange(this uint[] array, long index, uint update, uint comparand)

Atomically sets array element to the given updated value if the array element == the expected value.

public static uint DecrementAndGet(this ref uint value)

Atomically decrements the referenced value by one.

public static uint DecrementAndGet(this uint[] array, long index)

Atomically decrements the array element by one.

public static uint GetAndAccumulate(this ref uint value, uint x, Func<uint, uint, uint> accumulator)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the original value.

public static uint GetAndAccumulate(this ref uint value, uint x, method accumulator)

public static uint GetAndAccumulate(this uint[] array, long index, uint x, Func<uint, uint, uint> accumulator)

Atomically updates the array element with the results of applying the given function to the array element and given values, returning the original value.

public static uint GetAndAccumulate(this uint[] array, long index, uint x, method accumulator)

public static uint GetAndSet(this ref uint value, uint update)

Modifies the referenced value atomically.

public static uint GetAndSet(this uint[] array, long index, uint update)

Modifies the array element atomically.

public static uint GetAndUpdate(this ref uint value, Func<uint, uint> updater)

Atomically updates the stored value with the results of applying the given function, returning the original value.

public static uint GetAndUpdate(this ref uint value, method updater)

public static uint GetAndUpdate(this uint[] array, long index, Func<uint, uint> updater)

Atomically updates the array element with the results of applying the given function, returning the original value.

public static uint GetAndUpdate(this uint[] array, long index, method updater)

public static uint IncrementAndGet(this ref uint value)

Atomically increments the referenced value by one.

public static uint IncrementAndGet(this uint[] array, long index)

Atomically increments the array element by one.

public static uint SetAndGet(this ref uint value, uint update)

Modifies the referenced value atomically.

public static uint SetAndGet(this uint[] array, long index, uint update)

Modifies the array element atomically.

public static uint UpdateAndGet(this ref uint value, Func<uint, uint> updater)

Atomically updates the stored value with the results of applying the given function, returning the updated value.

public static uint UpdateAndGet(this ref uint value, method updater)

public static uint UpdateAndGet(this uint[] array, long index, Func<uint, uint> updater)

Atomically updates the array element with the results of applying the given function, returning the updated value.

public static uint UpdateAndGet(this uint[] array, long index, method updater)

public static uint VolatileRead(this ref uint value)

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

public static uint VolatileRead(this uint[] array, long index)

Performs volatile read of the array element.

public static void VolatileWrite(this ref uint value, uint newValue)

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

public static void VolatileWrite(this uint[] array, long index, uint value)

Performs volatile write to the array element.