/// <summary> /// Represents an atomic compare-exchange operation. /// </summary> /// <param name="target">the target location.</param> /// <param name="compare">The expected comparison value.</param> /// <param name="value">The value to add.</param> /// <returns>The old value.</returns> public static Index CompareExchange(VariableView <Index> target, Index compare, Index value) { return(CompareExchange(target.Cast <int>(), compare, value)); }
/// <summary> /// Atommically adds the given value and the value at the target location /// and returns the old value. /// </summary> /// <param name="target">the target location.</param> /// <param name="value">The value to add.</param> /// <returns>The old value that was stored at the target location.</returns> public static Index Add(VariableView <Index> target, Index value) { return(Add(target.Cast <int>(), value)); }
/// <summary> /// Represents an atomic compare-exchange operation. /// </summary> /// <param name="target">The target location.</param> /// <param name="compare">The expected comparison value.</param> /// <param name="value">The target value.</param> /// <returns>The old value.</returns> public static unsafe double CompareExchange(VariableView <double> target, double compare, double value) { var result = CompareExchange(target.Cast <long>(), *(long *)&compare, *(long *)&value); return(*(double *)&result); }
/// <summary> /// Represents an atomic compare-exchange operation. /// </summary> /// <param name="target">The target location.</param> /// <param name="compare">The expected comparison value.</param> /// <param name="value">The target value.</param> /// <returns>The old value.</returns> public static unsafe float CompareExchange(VariableView <float> target, float compare, float value) { var result = CompareExchange(target.Cast <int>(), *(int *)&compare, *(int *)&value); return(*(float *)&result); }
public static unsafe ulong CompareExchange(VariableView <ulong> target, ulong compare, ulong value) { var result = CompareExchange(target.Cast <long>(), *(long *)&compare, *(long *)&value); return(*(ulong *)&result); }
public static unsafe uint CompareExchange(VariableView <uint> target, uint compare, uint value) { var result = CompareExchange(target.Cast <int>(), *(int *)&compare, *(int *)&value); return(*(uint *)&result); }
/// <summary> /// Represents an atomic exchange operation. /// </summary> /// <param name="target">the target location.</param> /// <param name="value">The value to add.</param> /// <returns>The old value.</returns> public static Index Exchange(VariableView <Index> target, Index value) { return(Exchange(target.Cast <int>(), value)); }