mscorlib(4.0.0.0) API with additions
System.Threading.Volatile Class Reference

Contains methods for performing volatile memory operations. More...

Static Public Member Functions

static bool Read (ref bool location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static sbyte Read (ref sbyte location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static byte Read (ref byte location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static short Read (ref short location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static ushort Read (ref ushort location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static int Read (ref int location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static uint Read (ref uint location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static long Read (ref long location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static unsafe ulong Read (ref ulong location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static IntPtr Read (ref IntPtr location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static UIntPtr Read (ref UIntPtr location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static float Read (ref float location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static double Read (ref double location)
 Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static T Read< T > (ref T location)
 Reads the object reference from the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. More...
 
static void Write (ref bool location, bool value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref sbyte location, sbyte value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref byte location, byte value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref short location, short value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref ushort location, ushort value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref int location, int value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref uint location, uint value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref long location, long value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a memory operation appears before this method in the code, the processor cannot move it after this method. More...
 
static unsafe void Write (ref ulong location, ulong value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref IntPtr location, IntPtr value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref UIntPtr location, UIntPtr value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref float location, float value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write (ref double location, double value)
 Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 
static void Write< T > (ref T location, T value)
 Writes the specified object reference to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. More...
 

Detailed Description

Contains methods for performing volatile memory operations.

Definition at line 8 of file Volatile.cs.

Member Function Documentation

◆ Read() [1/13]

static bool System.Threading.Volatile.Read ( ref bool  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 15 of file Volatile.cs.

◆ Read() [2/13]

static sbyte System.Threading.Volatile.Read ( ref sbyte  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 28 of file Volatile.cs.

◆ Read() [3/13]

static byte System.Threading.Volatile.Read ( ref byte  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 40 of file Volatile.cs.

◆ Read() [4/13]

static short System.Threading.Volatile.Read ( ref short  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 52 of file Volatile.cs.

◆ Read() [5/13]

static ushort System.Threading.Volatile.Read ( ref ushort  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 65 of file Volatile.cs.

◆ Read() [6/13]

static int System.Threading.Volatile.Read ( ref int  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 77 of file Volatile.cs.

◆ Read() [7/13]

static uint System.Threading.Volatile.Read ( ref uint  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 90 of file Volatile.cs.

◆ Read() [8/13]

static long System.Threading.Volatile.Read ( ref long  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 102 of file Volatile.cs.

◆ Read() [9/13]

static unsafe ulong System.Threading.Volatile.Read ( ref ulong  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 114 of file Volatile.cs.

◆ Read() [10/13]

static IntPtr System.Threading.Volatile.Read ( ref IntPtr  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 126 of file Volatile.cs.

◆ Read() [11/13]

static UIntPtr System.Threading.Volatile.Read ( ref UIntPtr  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 138 of file Volatile.cs.

◆ Read() [12/13]

static float System.Threading.Volatile.Read ( ref float  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 150 of file Volatile.cs.

◆ Read() [13/13]

static double System.Threading.Volatile.Read ( ref double  location)
static

Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Returns
The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.

Definition at line 162 of file Volatile.cs.

◆ Read< T >()

static T System.Threading.Volatile.Read< T > ( ref T  location)
static

Reads the object reference from the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.

Parameters
locationThe field to read.
Template Parameters
TThe type of field to read. This must be a reference type, not a value type.
Returns
The reference to T that was read. This reference is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache.
Type Constraints
T :class 

Definition at line 174 of file Volatile.cs.

◆ Write() [1/13]

static void System.Threading.Volatile.Write ( ref bool  location,
bool  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 186 of file Volatile.cs.

◆ Write() [2/13]

static void System.Threading.Volatile.Write ( ref sbyte  location,
sbyte  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 198 of file Volatile.cs.

◆ Write() [3/13]

static void System.Threading.Volatile.Write ( ref byte  location,
byte  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 209 of file Volatile.cs.

◆ Write() [4/13]

static void System.Threading.Volatile.Write ( ref short  location,
short  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 220 of file Volatile.cs.

◆ Write() [5/13]

static void System.Threading.Volatile.Write ( ref ushort  location,
ushort  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 232 of file Volatile.cs.

◆ Write() [6/13]

static void System.Threading.Volatile.Write ( ref int  location,
int  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 243 of file Volatile.cs.

◆ Write() [7/13]

static void System.Threading.Volatile.Write ( ref uint  location,
uint  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 255 of file Volatile.cs.

◆ Write() [8/13]

static void System.Threading.Volatile.Write ( ref long  location,
long  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a memory operation appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 266 of file Volatile.cs.

◆ Write() [9/13]

static unsafe void System.Threading.Volatile.Write ( ref ulong  location,
ulong  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 278 of file Volatile.cs.

◆ Write() [10/13]

static void System.Threading.Volatile.Write ( ref IntPtr  location,
IntPtr  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 290 of file Volatile.cs.

◆ Write() [11/13]

static void System.Threading.Volatile.Write ( ref UIntPtr  location,
UIntPtr  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 301 of file Volatile.cs.

◆ Write() [12/13]

static void System.Threading.Volatile.Write ( ref float  location,
float  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 312 of file Volatile.cs.

◆ Write() [13/13]

static void System.Threading.Volatile.Write ( ref double  location,
double  value 
)
static

Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the value is written.
valueThe value to write. The value is written immediately so that it is visible to all processors in the computer.

Definition at line 323 of file Volatile.cs.

◆ Write< T >()

static void System.Threading.Volatile.Write< T > ( ref T  location,
value 
)
static

Writes the specified object reference to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method.

Parameters
locationThe field where the object reference is written.
valueThe object reference to write. The reference is written immediately so that it is visible to all processors in the computer.
Template Parameters
TThe type of field to write. This must be a reference type, not a value type.
Type Constraints
T :class 

Definition at line 335 of file Volatile.cs.


The documentation for this class was generated from the following file: