Class AtomicBoolean
Implementation of the java.concurrent.util.AtomicBoolean type.
Uses MemoryBarrier() internally to enforce ordering of writes without any explicit locking. .NET's strong memory on write guarantees might already enforce this ordering, but the addition of the MemoryBarrier guarantees it.
Inherited Members
Namespace: Akka.Util
Assembly: Akka.dll
Syntax
public class AtomicBoolean
Constructors
| Edit this page View SourceAtomicBoolean(bool)
Sets the initial value of this AtomicBoolean to initialValue
.
Declaration
public AtomicBoolean(bool initialValue = false)
Parameters
Type | Name | Description |
---|---|---|
bool | initialValue | TBD |
Properties
| Edit this page View SourceValue
The current value of this AtomicReference<T>
Declaration
public bool Value { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceCompareAndSet(bool, bool)
If Value equals expected
, then set the Value to
newValue
.
Declaration
public bool CompareAndSet(bool expected, bool newValue)
Parameters
Type | Name | Description |
---|---|---|
bool | expected | TBD |
bool | newValue | TBD |
Returns
Type | Description |
---|---|
bool |
|
GetAndSet(bool)
Declaration
public bool GetAndSet(bool newValue)
Parameters
Type | Name | Description |
---|---|---|
bool | newValue | The new value |
Returns
Type | Description |
---|---|
bool | The old value |
Operators
| Edit this page View Sourceimplicit operator bool(AtomicBoolean)
Performs an implicit conversion from AtomicBoolean to bool.
Declaration
public static implicit operator bool(AtomicBoolean atomicBoolean)
Parameters
Type | Name | Description |
---|---|---|
AtomicBoolean | atomicBoolean | The boolean to convert |
Returns
Type | Description |
---|---|
bool | The result of the conversion. |