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