DotNext by .NET Foundation and Contributors

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

 Atomic

public static class Atomic
Exposes atomic operations for thread-safe scenarios.
public struct Boolean : IEquatable<bool>

Represents atomic boolean.

public static double AccumulateAndGet<TAccumulator>(ref double value, double x, TAccumulator accumulator) where TAccumulator : ISupplier<double, double, double>

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 double AccumulateAndGet(ref double value, double x, Func<double, double, double> 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 IntPtr AccumulateAndGet<TAccumulator>(ref IntPtr value, IntPtr x, TAccumulator accumulator) where TAccumulator : ISupplier<IntPtr, IntPtr, IntPtr>

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 IntPtr AccumulateAndGet(ref IntPtr value, IntPtr x, Func<IntPtr, IntPtr, IntPtr> 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 int AccumulateAndGet<TAccumulator>(ref int value, int x, TAccumulator accumulator) where TAccumulator : ISupplier<int, int, int>

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 int AccumulateAndGet(ref int value, int x, Func<int, int, int> 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 long AccumulateAndGet<TAccumulator>(ref long value, long x, TAccumulator accumulator) where TAccumulator : ISupplier<long, long, long>

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 long AccumulateAndGet(ref long value, long x, Func<long, long, long> 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 float AccumulateAndGet<TAccumulator>(ref float value, float x, TAccumulator accumulator) where TAccumulator : ISupplier<float, float, float>

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 float AccumulateAndGet(ref float value, float x, Func<float, float, float> 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 UIntPtr AccumulateAndGet<TAccumulator>(ref UIntPtr value, UIntPtr x, TAccumulator accumulator) where TAccumulator : ISupplier<UIntPtr, UIntPtr, UIntPtr>

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 UIntPtr AccumulateAndGet(ref UIntPtr value, UIntPtr x, Func<UIntPtr, UIntPtr, UIntPtr> 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<TAccumulator>(ref uint value, uint x, TAccumulator accumulator) where TAccumulator : ISupplier<uint, uint, uint>

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(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 ulong AccumulateAndGet<TAccumulator>(ref ulong value, ulong x, TAccumulator accumulator) where TAccumulator : ISupplier<ulong, ulong, ulong>

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 ulong AccumulateAndGet(ref ulong value, ulong x, Func<ulong, ulong, ulong> 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 double GetAndAccumulate<TAccumulator>(ref double value, double x, TAccumulator accumulator) where TAccumulator : ISupplier<double, double, double>

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 double GetAndAccumulate(ref double value, double x, Func<double, double, double> 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 IntPtr GetAndAccumulate<TAccumulator>(ref IntPtr value, IntPtr x, TAccumulator accumulator) where TAccumulator : ISupplier<IntPtr, IntPtr, IntPtr>

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 IntPtr GetAndAccumulate(ref IntPtr value, IntPtr x, Func<IntPtr, IntPtr, IntPtr> 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 int GetAndAccumulate<TAccumulator>(ref int value, int x, TAccumulator accumulator) where TAccumulator : ISupplier<int, int, int>

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 int GetAndAccumulate(ref int value, int x, Func<int, int, int> 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 long GetAndAccumulate<TAccumulator>(ref long value, long x, TAccumulator accumulator) where TAccumulator : ISupplier<long, long, long>

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 long GetAndAccumulate(ref long value, long x, Func<long, long, long> 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 float GetAndAccumulate<TAccumulator>(ref float value, float x, TAccumulator accumulator) where TAccumulator : ISupplier<float, float, float>

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 float GetAndAccumulate(ref float value, float x, Func<float, float, float> 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 UIntPtr GetAndAccumulate<TAccumulator>(ref UIntPtr value, UIntPtr x, TAccumulator accumulator) where TAccumulator : ISupplier<UIntPtr, UIntPtr, UIntPtr>

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 UIntPtr GetAndAccumulate(ref UIntPtr value, UIntPtr x, Func<UIntPtr, UIntPtr, UIntPtr> 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<TAccumulator>(ref uint value, uint x, TAccumulator accumulator) where TAccumulator : ISupplier<uint, uint, uint>

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(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 ulong GetAndAccumulate<TAccumulator>(ref ulong value, ulong x, TAccumulator accumulator) where TAccumulator : ISupplier<ulong, ulong, ulong>

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 ulong GetAndAccumulate(ref ulong value, ulong x, Func<ulong, ulong, ulong> 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 double GetAndUpdate<TUpdater>(ref double value, TUpdater updater) where TUpdater : ISupplier<double, double>

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

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

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

public static IntPtr GetAndUpdate<TUpdater>(ref IntPtr value, TUpdater updater) where TUpdater : ISupplier<IntPtr, IntPtr>

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

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

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

public static int GetAndUpdate<TUpdater>(ref int value, TUpdater updater) where TUpdater : ISupplier<int, int>

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

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

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

public static long GetAndUpdate<TUpdater>(ref long value, TUpdater updater) where TUpdater : ISupplier<long, long>

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

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

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

public static float GetAndUpdate<TUpdater>(ref float value, TUpdater updater) where TUpdater : ISupplier<float, float>

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

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

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

public static UIntPtr GetAndUpdate<TUpdater>(ref UIntPtr value, TUpdater updater) where TUpdater : ISupplier<UIntPtr, UIntPtr>

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

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

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

public static uint GetAndUpdate<TUpdater>(ref uint value, TUpdater updater) where TUpdater : ISupplier<uint, uint>

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

public static uint GetAndUpdate(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 ulong GetAndUpdate<TUpdater>(ref ulong value, TUpdater updater) where TUpdater : ISupplier<ulong, ulong>

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

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

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

public static bool IsAtomic<T>()

Determines that write to the location in the memory of type T is atomic.

public static double UpdateAndGet<TUpdater>(ref double value, TUpdater updater) where TUpdater : ISupplier<double, double>

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

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

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

public static IntPtr UpdateAndGet<TUpdater>(ref IntPtr value, TUpdater updater) where TUpdater : ISupplier<IntPtr, IntPtr>

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

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

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

public static int UpdateAndGet<TUpdater>(ref int value, TUpdater updater) where TUpdater : ISupplier<int, int>

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

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

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

public static long UpdateAndGet<TUpdater>(ref long value, TUpdater updater) where TUpdater : ISupplier<long, long>

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

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

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

public static float UpdateAndGet<TUpdater>(ref float value, TUpdater updater) where TUpdater : ISupplier<float, float>

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

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

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

public static UIntPtr UpdateAndGet<TUpdater>(ref UIntPtr value, TUpdater updater) where TUpdater : ISupplier<UIntPtr, UIntPtr>

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

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

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

public static uint UpdateAndGet<TUpdater>(ref uint value, TUpdater updater) where TUpdater : ISupplier<uint, uint>

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

public static uint UpdateAndGet(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 ulong UpdateAndGet<TUpdater>(ref ulong value, TUpdater updater) where TUpdater : ISupplier<ulong, ulong>

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

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

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