Class AtomicInteger
Represents an atomically readable or writable integer.
Inherited Members
Namespace: Swan.Threading
Syntax
public class AtomicInteger : AtomicTypeBase<int>, IComparable<int>, IComparable<AtomicTypeBase<int>>, IEquatable<int>, IEquatable<AtomicTypeBase<int>>
Constructors
AtomicInteger(Int32)
Initializes a new instance of the AtomicInteger class.
Declaration
public AtomicInteger(int initialValue = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | initialValue | if set to |
Methods
FromLong(Int64)
Converts from a long value to the target type.
Declaration
protected override int FromLong(long backingValue)
Parameters
Type | Name | Description |
---|---|---|
Int64 | backingValue | The backing value. |
Returns
Type | Description |
---|---|
Int32 | The value converted form a long value. |
Overrides
Swan.Threading.AtomicTypeBase<System.Int32>.FromLong(System.Int64)
ToLong(Int32)
Converts from the target type to a long value.
Declaration
protected override long ToLong(int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value |
Returns
Type | Description |
---|---|
Int64 | The value converted to a long value. |
Overrides
Swan.Threading.AtomicTypeBase<System.Int32>.ToLong(System.Int32)
Implements
IComparable<>
IComparable<>
IEquatable<>
IEquatable<>