BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object

The methods of this class help protect against errors that can occur when the scheduler switches contexts while a thread is updating a variable that can be accessed by other threads, or when two threads are executing concurrently on separate processors. The members of this class do not throw exceptions.

The and methods increment or decrement a variable and store the resulting value in a single operation. On most computers, incrementing a variable is not an atomic operation, requiring the following steps:

Load a value from an instance variable into a register.

Increment or decrement the value.

Store the value in the instance variable.

If you do not use and , a thread can be preempted after executing the first two steps. Another thread can then execute all three steps. When the first thread resumes execution, it overwrites the value in the instance variable, and the effect of the increment or decrement performed by the second thread is lost.

The method atomically exchanges the values of the specified variables. The method combines two operations: comparing two values and storing a third value in one of the variables, based on the outcome of the comparison. The compare and exchange operations are performed as an atomic operation.

Provides atomic operations for variables that are shared by multiple threads.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int64 `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Double `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` `` `` A reference whose value is updated with if the original value of is equal to . A whose value will replace the value of if and are equal. A to be compared to

  Compares two values for equality and stores a specified value if they are equal.

  The original value of .

  The compare and store operations are performed as an atomic operation.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Int64 `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.IntPtr `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Object `` `` `` A reference that is set to if the object to which it refers is equal to . The reference that will replace the value of if and are equal. An object to be compared to that referred to by

  Compares two variables for equality and stores a specified object if they are equal.

  A containing the original value of .

  The compare and store operations are performed as an atomic operation.

  The address of is . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` `` `` A whose value is updated with if its original value is equal to . The value that will replace value of if and are equal. A to be compared to

  Compares two values for equality and stores a specified value if they are equal.

  A containing the original value of .

  The compare and store operations are performed as an atomic operation.

  The address of is . 1 ExtendedNumerics
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Runtime.InteropServices.ComVisible(false)
  T ReferenceTypeConstraint `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` A containing the variable whose value is to be decremented.

  Decrements the specified variable and stores the result as an atomic operation.

  A containing the decremented value.

  This method handles an overflow condition by wrapping: if = , - 1 = . No exception is thrown.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` A containing the variable whose value is to be decremented.

  Decrements the specified variable and stores the result as an atomic operation.

  A containing the decremented value.

  This method handles an overflow condition by wrapping: if = , - 1 = . No exception is thrown.

  The 64-bit versions of and are truly atomic only on systems where a is 64-bits long. On other systems, these methods are atomic with respect to each other, but not with respect to other means of accessing the data.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Double `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` `` A variable to set to the supplied value as an atomic operation. The value to which is set.

  Sets a variable to a specified value as an atomic operation and returns the original value.

  A containing the value of before the exchange.

  To be added. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int64 `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.IntPtr `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Object `` `` The variable to set. The reference to which is set.

  Sets a reference to refer to a specified object as an atomic operation and returns a reference to the original object.

  The original value of .

  To be added. The address of is . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` `` A variable to set to the supplied value as an atomic operation. The value to which is set.

  Sets a variable to a specified value as an atomic operation and returns the original value.

  A containing the value of before the exchange.

  To be added. 1 ExtendedNumerics
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Runtime.InteropServices.ComVisible(false)
  T ReferenceTypeConstraint `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` A containing the variable whose value is to be incremented.

  Increments the specified variable and stores the result as an atomic operation.

  A containing the incremented value.

  This method handles an overflow condition by wrapping: if = , + 1 = . No exception is thrown.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int64 `` A containing the variable whose value is to be incremented.

  Increments the specified variable and stores the result as an atomic operation.

  A containing the incremented value.

  This method handles an overflow condition by wrapping: if = , + 1 = . No exception is thrown.

  The 64-bit versions of and are truly atomic only on systems where a is 64-bits long. On other systems, these methods are atomic with respect to each other, but not with respect to other means of accessing the data.

  0
- Method
  4.0.0.0
  System.Void

  This method was added to the class in the net_v45 as a convenience; it's a wrapper for the method.

  is required only on multiprocessor systems that have weak memory ordering (for example, a system that employs multiple Intel Itanium processors).

  For most purposes, the C# lock statement, the Visual Basic SyncLock statement, or the class provide easier ways to synchronize data.

  Synchronizes memory access as follows: The processor that executes the current thread cannot reorder instructions in such a way that memory accesses before the call to execute after memory accesses that follow the call to .

- Method
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added. To be added. To be added. To be added.
0