C# Class OpenStory.Common.AtomicInteger

Represents a thread-safe Int32 value.
Afficher le fichier Open project: shoftee/OpenStory Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

CompareExchange() public méthode

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.
Résultat int

Decrement() public méthode

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

ExchangeWith() public méthode

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

Increment() public méthode

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

ToInt32() public méthode

Extracts a Int32 from an AtomicInteger instance.
public ToInt32 ( ) : int
Résultat int

ToInt32() public static méthode

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.
Résultat int