C# Class Ariadne.SharedInt32

A simple means to share an atomically-maintained count between objects.
Show file Open project: JonHanna/Ariadne

Public Methods

Method Description
Add ( int addend ) : int

Atomically add a value to the Ariadne.SharedInt32.

Decrement ( ) : int

Atomically decrement the value of the Ariadne.SharedInt32 by one.

Exchange ( int value ) : int

Atomically replace the value of the Ariadne.SharedInt32, returning the previous value.

Increment ( ) : int

Atomically increment the value of the Ariadne.SharedInt32 by one.

SharedInt32 ( ) : System.Threading

Initialises a new instance of the Ariadne.SharedInt32 class, with a value of zero.

SharedInt32 ( int value ) : System.Threading

Initialises a new instance of the Ariadne.SharedInt32 class, with an initial value.

Subtract ( int subtrahend ) : int

Atomically subtract a value from the Ariadne.SharedInt32.

Method Details

Add() public method

Atomically add a value to the Ariadne.SharedInt32.
public Add ( int addend ) : int
addend int The number to add to the .
return int

Decrement() public method

Atomically decrement the value of the Ariadne.SharedInt32 by one.
public Decrement ( ) : int
return int

Exchange() public method

Atomically replace the value of the Ariadne.SharedInt32, returning the previous value.
public Exchange ( int value ) : int
value int The number to set the to.
return int

Increment() public method

Atomically increment the value of the Ariadne.SharedInt32 by one.
public Increment ( ) : int
return int

SharedInt32() public method

Initialises a new instance of the Ariadne.SharedInt32 class, with a value of zero.
public SharedInt32 ( ) : System.Threading
return System.Threading

SharedInt32() public method

Initialises a new instance of the Ariadne.SharedInt32 class, with an initial value.
public SharedInt32 ( int value ) : System.Threading
value int The initial value of the .
return System.Threading

Subtract() public method

Atomically subtract a value from the Ariadne.SharedInt32.
public Subtract ( int subtrahend ) : int
subtrahend int The number to subtract from the .
return int