using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace System.Threading
{
/// Provides atomic operations for variables that are shared by multiple threads.
/// 2
// Token: 0x02000611 RID: 1553
public static class Interlocked
{
/// Compares two 32-bit signed integers for equality and, if they are equal, replaces one of the values.
/// The original value in .
/// The destination, whose value is compared with and possibly replaced.
/// The value that replaces the destination value if the comparison results in equality.
/// The value that is compared to the value at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038B7 RID: 14519
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int CompareExchange(ref int location1, int value, int comparand);
/// Compares two objects for reference equality and, if they are equal, replaces one of the objects.
/// The original value in .
/// The destination object that is compared with and possibly replaced.
/// The object that replaces the destination object if the comparison results in equality.
/// The object that is compared to the object at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038B8 RID: 14520
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern object CompareExchange(ref object location1, object value, object comparand);
/// Compares two single-precision floating point numbers for equality and, if they are equal, replaces one of the values.
/// The original value in .
/// The destination, whose value is compared with and possibly replaced.
/// The value that replaces the destination value if the comparison results in equality.
/// The value that is compared to the value at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038B9 RID: 14521
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern float CompareExchange(ref float location1, float value, float comparand);
/// Decrements a specified variable and stores the result, as an atomic operation.
/// The decremented value.
/// The variable whose value is to be decremented.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BA RID: 14522
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int Decrement(ref int location);
/// Decrements the specified variable and stores the result, as an atomic operation.
/// The decremented value.
/// The variable whose value is to be decremented.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BB RID: 14523
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long Decrement(ref long location);
/// Increments a specified variable and stores the result, as an atomic operation.
/// The incremented value.
/// The variable whose value is to be incremented.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BC RID: 14524
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int Increment(ref int location);
/// Increments a specified variable and stores the result, as an atomic operation.
/// The incremented value.
/// The variable whose value is to be incremented.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BD RID: 14525
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long Increment(ref long location);
/// Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BE RID: 14526
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int Exchange(ref int location1, int value);
/// Sets an object to a specified value and returns a reference to the original object, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038BF RID: 14527
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern object Exchange(ref object location1, object value);
/// Sets a single-precision floating point number to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038C0 RID: 14528
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern float Exchange(ref float location1, float value);
/// Compares two 64-bit signed integers for equality and, if they are equal, replaces one of the values.
/// The original value in .
/// The destination, whose value is compared with and possibly replaced.
/// The value that replaces the destination value if the comparison results in equality.
/// The value that is compared to the value at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038C1 RID: 14529
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long CompareExchange(ref long location1, long value, long comparand);
/// Compares two platform-specific handles or pointers for equality and, if they are equal, replaces one of them.
/// The original value in .
/// The destination , whose value is compared with the value of and possibly replaced by .
/// The that replaces the destination value if the comparison results in equality.
/// The that is compared to the value at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038C2 RID: 14530
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr comparand);
/// Compares two double-precision floating point numbers for equality and, if they are equal, replaces one of the values.
/// The original value in .
/// The destination, whose value is compared with and possibly replaced.
/// The value that replaces the destination value if the comparison results in equality.
/// The value that is compared to the value at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038C3 RID: 14531
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern double CompareExchange(ref double location1, double value, double comparand);
/// Compares two instances of the specified reference type for equality and, if they are equal, replaces one of them.
/// The original value in .
/// The destination, whose value is compared with and possibly replaced. This is a reference parameter (ref in C#, ByRef in Visual Basic).
/// The value that replaces the destination value if the comparison results in equality.
/// The value that is compared to the value at .
/// The type to be used for , , and . This type must be a reference type.
/// The address of is a null pointer.
// Token: 0x060038C4 RID: 14532
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[ComVisible(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern T CompareExchange(ref T location1, T value, T comparand) where T : class;
/// Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038C5 RID: 14533
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long Exchange(ref long location1, long value);
/// Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038C6 RID: 14534
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr Exchange(ref IntPtr location1, IntPtr value);
/// Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value.
/// The value to which the parameter is set.
/// The address of is a null pointer.
/// 1
// Token: 0x060038C7 RID: 14535
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern double Exchange(ref double location1, double value);
/// Sets a variable of the specified type to a specified value and returns the original value, as an atomic operation.
/// The original value of .
/// The variable to set to the specified value. This is a reference parameter (ref in C#, ByRef in Visual Basic).
/// The value to which the parameter is set.
/// The type to be used for and . This type must be a reference type.
/// The address of is a null pointer.
// Token: 0x060038C8 RID: 14536
[ComVisible(false)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern T Exchange(ref T location1, T value) where T : class;
/// Returns a 64-bit value, loaded as an atomic operation.
/// The loaded value.
/// The 64-bit value to be loaded.
/// 1
// Token: 0x060038C9 RID: 14537
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long Read(ref long location);
/// Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.
/// The new value stored at .
/// A variable containing the first value to be added. The sum of the two values is stored in .
/// The value to be added to the integer at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038CA RID: 14538
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int Add(ref int location1, int value);
/// Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.
/// The new value stored at .
/// A variable containing the first value to be added. The sum of the two values is stored in .
/// The value to be added to the integer at .
/// The address of is a null pointer.
/// 1
// Token: 0x060038CB RID: 14539
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long Add(ref long location1, long value);
}
}