9 [__DynamicallyInvokable]
16 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
17 [__DynamicallyInvokable]
20 return Add(ref location, 1);
27 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
28 [__DynamicallyInvokable]
31 return Add(ref location, 1
L);
38 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
39 [__DynamicallyInvokable]
42 return Add(ref location, -1);
49 [__DynamicallyInvokable]
52 return Add(ref location, -1
L);
61 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
62 [SecuritySafeCritical]
63 [__DynamicallyInvokable]
64 public static extern int Exchange(ref
int location1,
int value);
72 [SecuritySafeCritical]
73 [__DynamicallyInvokable]
74 public static extern long Exchange(ref
long location1,
long value);
82 [SecuritySafeCritical]
83 [__DynamicallyInvokable]
84 public static extern float Exchange(ref
float location1,
float value);
92 [SecuritySafeCritical]
93 [__DynamicallyInvokable]
94 public static extern double Exchange(ref
double location1,
double value);
102 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
103 [SecuritySafeCritical]
104 [__DynamicallyInvokable]
105 public static extern object Exchange(ref
object location1,
object value);
113 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
114 [SecuritySafeCritical]
123 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
125 [SecuritySafeCritical]
126 [__DynamicallyInvokable]
129 _Exchange(__makeref(location1), __makeref(value));
134 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
135 [SecuritySafeCritical]
145 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
146 [SecuritySafeCritical]
147 [__DynamicallyInvokable]
148 public static extern int CompareExchange(ref
int location1,
int value,
int comparand);
157 [SecuritySafeCritical]
158 [__DynamicallyInvokable]
159 public static extern long CompareExchange(ref
long location1,
long value,
long comparand);
168 [SecuritySafeCritical]
169 [__DynamicallyInvokable]
170 public static extern float CompareExchange(ref
float location1,
float value,
float comparand);
179 [SecuritySafeCritical]
180 [__DynamicallyInvokable]
181 public static extern double CompareExchange(ref
double location1,
double value,
double comparand);
190 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
191 [SecuritySafeCritical]
192 [__DynamicallyInvokable]
193 public static extern object CompareExchange(ref
object location1,
object value,
object comparand);
202 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
203 [SecuritySafeCritical]
213 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
215 [SecuritySafeCritical]
216 [__DynamicallyInvokable]
219 _CompareExchange(__makeref(location1), __makeref(value), comparand);
224 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
225 [SecuritySafeCritical]
229 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
230 [SecuritySafeCritical]
231 internal static extern int CompareExchange(ref
int location1,
int value,
int comparand, ref
bool succeeded);
234 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
235 internal static extern int ExchangeAdd(ref
int location1,
int value);
238 internal static extern long ExchangeAdd(ref
long location1,
long value);
245 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
246 [__DynamicallyInvokable]
247 public static int Add(ref
int location1,
int value)
249 return ExchangeAdd(ref location1, value) + value;
257 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
258 [__DynamicallyInvokable]
259 public static long Add(ref
long location1,
long value)
261 return ExchangeAdd(ref location1, value) + value;
267 [__DynamicallyInvokable]
268 public static long Read(ref
long location)
275 [__DynamicallyInvokable]
static long Read(ref long location)
Returns a 64-bit value, loaded as an atomic operation.
static void MemoryBarrier()
Synchronizes memory access as follows: The processor executing the current thread cannot reorder inst...
static long Decrement(ref long location)
Decrements the specified variable and stores the result, as an atomic operation.
static void MemoryBarrier()
Synchronizes memory access as follows: The processor that executes the current thread cannot reorder ...
static T CompareExchange< T >(ref T location1, T value, T comparand)
Compares two instances of the specified reference type T for equality and, if they are equal,...
static T Exchange< T >(ref T location1, T value)
Sets a variable of the specified type T to a specified value and returns the original value,...
static int Exchange(ref int location1, int value)
Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operat...
Cer
Specifies a method's behavior when called within a constrained execution region.
static long Add(ref long location1, long value)
Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.
Describes objects that contain both a managed pointer to a location and a runtime representation of t...
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
static int Increment(ref int location)
Increments a specified variable and stores the result, as an atomic operation.
A platform-specific type that is used to represent a pointer or a handle.
MethodImplOptions
Defines the details of how a method is implemented.
Consistency
Specifies a reliability contract.
static int Decrement(ref int location)
Decrements a specified variable and stores the result, as an atomic operation.
static int Add(ref int location1, int value)
Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.
static long Increment(ref long location)
Increments a specified variable and stores the result, as an atomic operation.
Provides atomic operations for variables that are shared by multiple threads.
Creates and controls a thread, sets its priority, and gets its status.