Header menu logo TDesu.FSharp

AtomicInt Type

Thread-safe atomic counter using Interlocked. Zero-allocation reads.

Constructors

Constructor Description

AtomicInt()

Full Usage: AtomicInt()

Returns: AtomicInt
Returns: AtomicInt

AtomicInt(initial)

Full Usage: AtomicInt(initial)

Parameters:
    initial : int

Returns: AtomicInt
initial : int
Returns: AtomicInt

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    delta : int

Returns: int

Adds delta and returns the new value. The value to add to the counter.

delta : int
Returns: int

this.CompareExchange

Full Usage: this.CompareExchange

Parameters:
    newValue : int
    comparand : int

Returns: bool

Sets to newValue if current equals comparand. Returns true if exchanged. The value to set if the current value matches the comparand. The value to compare against.

newValue : int
comparand : int
Returns: bool

this.Decrement

Full Usage: this.Decrement

Returns: int

Decrements and returns the new value.

Returns: int

this.Exchange

Full Usage: this.Exchange

Parameters:
    newValue : int

Returns: int

Sets to newValue, returns the old value. The value to set.

newValue : int
Returns: int

this.Increment

Full Usage: this.Increment

Returns: int

Increments and returns the new value.

Returns: int

this.Reset

Full Usage: this.Reset

Returns: int

Resets to 0 and returns previous value.

Returns: int

this.Value

Full Usage: this.Value

Returns: int

Gets the current value.

Returns: int

Type something to start searching.