C# Class Corlib.Threading.AtomicUInt64

Show file Open project: GeorgeTsiokos/corlib Class Usage Examples

Public Methods

Method Description
CompareExchange ( ulong value, ulong comparand ) : ulong

Compares the type's value with comparand for equality, and if they're equal, replaces the value with value

Create ( ) : AtomicUInt64

Creates a new value starting at 0

Decrement ( ) : void

Decrements the value

DecrementAndReturn ( ) : ulong

Decrements the value

Exchange ( ulong value ) : ulong

Sets a specified value and returns the original value, as an atomic operation

Increment ( ) : void

Increments the value

IncrementAndReturn ( ) : ulong

Increments the value

SetAndReturn ( ulong value ) : ulong

Sets the value

Private Methods

Method Description
Calculate ( ulong value ) : long
Calculate ( long value ) : ulong
Get ( ) : long
Set ( long value ) : long

Method Details

CompareExchange() public method

Compares the type's value with comparand for equality, and if they're equal, replaces the value with value
public CompareExchange ( ulong value, ulong comparand ) : ulong
value ulong the replacement value
comparand ulong the value to compare against
return ulong

Create() public static method

Creates a new value starting at 0
public static Create ( ) : AtomicUInt64
return AtomicUInt64

Decrement() public method

Decrements the value
public Decrement ( ) : void
return void

DecrementAndReturn() public method

Decrements the value
public DecrementAndReturn ( ) : ulong
return ulong

Exchange() public method

Sets a specified value and returns the original value, as an atomic operation
public Exchange ( ulong value ) : ulong
value ulong new value
return ulong

Increment() public method

Increments the value
public Increment ( ) : void
return void

IncrementAndReturn() public method

Increments the value
public IncrementAndReturn ( ) : ulong
return ulong

SetAndReturn() public method

Sets the value
public SetAndReturn ( ulong value ) : ulong
value ulong the new value
return ulong