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
| Improve this Doc View SourceAtomicBoolean(Boolean)
Sets the initial value of this AtomicBoolean to initialValue
.
Declaration
public AtomicBoolean(bool initialValue = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | initialValue | TBD |
Properties
| Improve this Doc View SourceValue
The current value of this AtomicReference<T>
Declaration
public bool Value { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceCompareAndSet(Boolean, Boolean)
If Value equals expected
, then set the Value to
newValue
.
Declaration
public bool CompareAndSet(bool expected, bool newValue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | expected | TBD |
Boolean | newValue | TBD |
Returns
Type | Description |
---|---|
Boolean |
|
GetAndSet(Boolean)
Declaration
public bool GetAndSet(bool newValue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | newValue | The new value |
Returns
Type | Description |
---|---|
Boolean | The old value |
Operators
| Improve this Doc View SourceImplicit(AtomicBoolean to Boolean)
Performs an implicit conversion from AtomicBoolean to Boolean.
Declaration
public static implicit operator bool (AtomicBoolean atomicBoolean)
Parameters
Type | Name | Description |
---|---|---|
AtomicBoolean | atomicBoolean | The boolean to convert |
Returns
Type | Description |
---|---|
Boolean | The result of the conversion. |