C# Класс OpenStory.Common.AtomicInteger

Represents a thread-safe Int32 value.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

AtomicInteger() публичный Метод

Initializes a new instance of the AtomicInteger class with the given value.
public AtomicInteger ( int initialValue ) : System
initialValue int The initial value.
Результат System

CompareExchange() публичный Метод

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.
Результат int

Decrement() публичный Метод

Decrements the value of this AtomicInteger by one and returns the new value.
public Decrement ( ) : int
Результат int

ExchangeWith() публичный Метод

Exchanges the value of this AtomicInteger by with newValue and returns the original value.
public ExchangeWith ( int newValue ) : int
newValue int The new value.
Результат int

Increment() публичный Метод

Increments the value of this AtomicInteger by one and returns the new value.
public Increment ( ) : int
Результат int

ToInt32() публичный Метод

Extracts a Int32 from an AtomicInteger instance.
public ToInt32 ( ) : int
Результат int

ToInt32() публичный статический Метод

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.
Результат int