Class AtomicLong
Fast, atomic long combining interlocked to write value and volatile to read values.
Inherited Members
Namespace: Swan.Threading
Syntax
public sealed class AtomicLong : AtomicTypeBase<long>, IComparable<long>, IComparable<AtomicTypeBase<long>>, IEquatable<long>, IEquatable<AtomicTypeBase<long>>
Constructors
AtomicLong(Int64)
Initializes a new instance of the AtomicLong class.
Declaration
public AtomicLong(long initialValue = 0L)
Parameters
Type | Name | Description |
---|---|---|
Int64 | initialValue | if set to |
Methods
FromLong(Int64)
Converts from a long value to the target type.
Declaration
protected override long FromLong(long backingValue)
Parameters
Type | Name | Description |
---|---|---|
Int64 | backingValue | The backing value. |
Returns
Type | Description |
---|---|
Int64 | The value converted form a long value. |
Overrides
Swan.Threading.AtomicTypeBase<System.Int64>.FromLong(System.Int64)
ToLong(Int64)
Converts from the target type to a long value.
Declaration
protected override long ToLong(long value)
Parameters
Type | Name | Description |
---|---|---|
Int64 | value |
Returns
Type | Description |
---|---|
Int64 | The value converted to a long value. |
Overrides
Swan.Threading.AtomicTypeBase<System.Int64>.ToLong(System.Int64)
Implements
IComparable<>
IComparable<>
IEquatable<>
IEquatable<>