DotMP
Static Public Member Functions | List of all members
DotMP.Atomic Class Reference

Provides atomic operations for integral types as a wrapper around the Interlocked class. Adds support for signed and unsigned 32- and 64-bit integers. Supports addition, subtraction (for signed types), increment, decrement, bitwise And, and bitwise Or. More...

Static Public Member Functions

static int Add (ref int target, int value)
 Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation. More...
 
static int Sub (ref int target, int value)
 Subtracts two 32-bit integers and replaces the first integer with the difference, as an atomic operation. More...
 
static int Inc (ref int target)
 Increments a specified 32-bit integer by one and stores the result, as an atomic operation. More...
 
static int Dec (ref int target)
 Decrements a specified 32-bit integer by one and stores the result, as an atomic operation. More...
 
static uint Add (ref uint target, uint value)
 Adds two 32-bit unsigned integers and replaces the first integer with the sum, as an atomic operation. More...
 
static uint Sub (ref uint target, uint value)
 Subtracts two 32-bit unsigned integers and replaces the first integer with the difference, as an atomic operation. More...
 
static uint Inc (ref uint target)
 Increments a specified 32-bit unsigned integer by one and stores the result, as an atomic operation. More...
 
static uint Dec (ref uint target)
 Decrements a specified 32-bit unsigned integer by one and stores the result, as an atomic operation. More...
 
static long Add (ref long target, long value)
 Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation. More...
 
static long Sub (ref long target, long value)
 Subtracts two 64-bit integers and replaces the first integer with the difference, as an atomic operation. More...
 
static long Inc (ref long target)
 Increments a specified 64-bit integer by one and stores the result, as an atomic operation. More...
 
static long Dec (ref long target)
 Decrements a specified 64-bit integer by one and stores the result, as an atomic operation. More...
 
static ulong Add (ref ulong target, ulong value)
 Adds two 64-bit unsigned integers and replaces the first integer with the sum, as an atomic operation. More...
 
static ulong Sub (ref ulong target, ulong value)
 Subtracts two 64-bit unsigned integers and replaces the first integer with the difference, as an atomic operation. More...
 
static ulong Inc (ref ulong target)
 Increments a specified 64-bit unsigned integer by one and stores the result, as an atomic operation. More...
 
static ulong Dec (ref ulong target)
 Decrements a specified 64-bit unsigned integer by one and stores the result, as an atomic operation. More...
 

Detailed Description

Provides atomic operations for integral types as a wrapper around the Interlocked class. Adds support for signed and unsigned 32- and 64-bit integers. Supports addition, subtraction (for signed types), increment, decrement, bitwise And, and bitwise Or.

Member Function Documentation

◆ Add() [1/4]

static int DotMP.Atomic.Add ( ref int  target,
int  value 
)
inlinestatic

Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to add to the destination integer.
Returns
The new value stored as a result of the operation.

◆ Add() [2/4]

static long DotMP.Atomic.Add ( ref long  target,
long  value 
)
inlinestatic

Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to add to the destination integer.
Returns
The new value stored as a result of the operation.

◆ Add() [3/4]

static uint DotMP.Atomic.Add ( ref uint  target,
uint  value 
)
inlinestatic

Adds two 32-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to add to the destination integer.
Returns
The new value stored as a result of the operation.

◆ Add() [4/4]

static ulong DotMP.Atomic.Add ( ref ulong  target,
ulong  value 
)
inlinestatic

Adds two 64-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to add to the destination integer.
Returns
The new value stored as a result of the operation.

◆ Dec() [1/4]

static int DotMP.Atomic.Dec ( ref int  target)
inlinestatic

Decrements a specified 32-bit integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be decremented.
Returns
The new value stored as a result of the operation.

◆ Dec() [2/4]

static long DotMP.Atomic.Dec ( ref long  target)
inlinestatic

Decrements a specified 64-bit integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be decremented.
Returns
The new value stored as a result of the operation.

◆ Dec() [3/4]

static uint DotMP.Atomic.Dec ( ref uint  target)
inlinestatic

Decrements a specified 32-bit unsigned integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be decremented.
Returns
The new value stored as a result of the operation.

◆ Dec() [4/4]

static ulong DotMP.Atomic.Dec ( ref ulong  target)
inlinestatic

Decrements a specified 64-bit unsigned integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be decremented.
Returns
The new value stored as a result of the operation.

◆ Inc() [1/4]

static int DotMP.Atomic.Inc ( ref int  target)
inlinestatic

Increments a specified 32-bit integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be incremented.
Returns
The new value stored as a result of the operation.

◆ Inc() [2/4]

static long DotMP.Atomic.Inc ( ref long  target)
inlinestatic

Increments a specified 64-bit integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be incremented.
Returns
The new value stored as a result of the operation.

◆ Inc() [3/4]

static uint DotMP.Atomic.Inc ( ref uint  target)
inlinestatic

Increments a specified 32-bit unsigned integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be incremented.
Returns
The new value stored as a result of the operation.

◆ Inc() [4/4]

static ulong DotMP.Atomic.Inc ( ref ulong  target)
inlinestatic

Increments a specified 64-bit unsigned integer by one and stores the result, as an atomic operation.

Parameters
targetThe destination integer to be incremented.
Returns
The new value stored as a result of the operation.

◆ Sub() [1/4]

static int DotMP.Atomic.Sub ( ref int  target,
int  value 
)
inlinestatic

Subtracts two 32-bit integers and replaces the first integer with the difference, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to subtract from the destination integer.
Returns
The new value stored as a result of the operation.

◆ Sub() [2/4]

static long DotMP.Atomic.Sub ( ref long  target,
long  value 
)
inlinestatic

Subtracts two 64-bit integers and replaces the first integer with the difference, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to subtract from the destination integer.
Returns
The new value stored as a result of the operation.

◆ Sub() [3/4]

static uint DotMP.Atomic.Sub ( ref uint  target,
uint  value 
)
inlinestatic

Subtracts two 32-bit unsigned integers and replaces the first integer with the difference, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to subtract from the destination integer.
Returns
The new value stored as a result of the operation.

◆ Sub() [4/4]

static ulong DotMP.Atomic.Sub ( ref ulong  target,
ulong  value 
)
inlinestatic

Subtracts two 64-bit unsigned integers and replaces the first integer with the difference, as an atomic operation.

Parameters
targetThe destination integer to be replaced.
valueThe value to subtract from the destination integer.
Returns
The new value stored as a result of the operation.

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