C# Class OpenStory.Common.AtomicInteger

Represents a thread-safe Int32 value.
ファイルを表示 Open project: shoftee/OpenStory Class Usage Examples

Public Methods

Method Description
AtomicInteger ( int initialValue ) : System

Initializes a new instance of the AtomicInteger class with the given value.

CompareExchange ( int comparand, int newValue ) : int

Assigns a new value to the AtomicInteger if the current value is equal to a specified one, and returns the original value.

See Interlocked.CompareExchange(ref int,int,int) for details.

Decrement ( ) : int

Decrements the value of this AtomicInteger by one and returns the new value.

ExchangeWith ( int newValue ) : int

Exchanges the value of this AtomicInteger by with newValue and returns the original value.

Increment ( ) : int

Increments the value of this AtomicInteger by one and returns the new value.

ToInt32 ( ) : int

Extracts a Int32 from an AtomicInteger instance.

ToInt32 ( AtomicInteger atomicInteger ) : int

Extracts a Int32 from an instance of AtomicInteger.

Method Details

AtomicInteger() public method

Initializes a new instance of the AtomicInteger class with the given value.
public AtomicInteger ( int initialValue ) : System
initialValue int The initial value.
return System

CompareExchange() public method

Assigns a new value to the AtomicInteger if the current value is equal to a specified one, and returns the original value.
See Interlocked.CompareExchange(ref int,int,int) for details.
public CompareExchange ( int comparand, int newValue ) : int
comparand int The value to compare for equality with.
newValue int The value to assign if the and comparand are equal.
return int

Decrement() public method

Decrements the value of this AtomicInteger by one and returns the new value.
public Decrement ( ) : int
return int

ExchangeWith() public method

Exchanges the value of this AtomicInteger by with newValue and returns the original value.
public ExchangeWith ( int newValue ) : int
newValue int The new value.
return int

Increment() public method

Increments the value of this AtomicInteger by one and returns the new value.
public Increment ( ) : int
return int

ToInt32() public method

Extracts a Int32 from an AtomicInteger instance.
public ToInt32 ( ) : int
return int

ToInt32() public static method

Extracts a Int32 from an instance of AtomicInteger.
/// Thrown if is . ///
public static ToInt32 ( AtomicInteger atomicInteger ) : int
atomicInteger AtomicInteger The to extract the value of.
return int