Class AtomicReference<T>
Implementation of the java.concurrent.util AtomicReference type.
Uses Volatile 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 Volatile guarantees it.
Inherited Members
Namespace: Akka.Util
Assembly: Akka.dll
Syntax
public class AtomicReference<T>
where T : class
Type Parameters
Name | Description |
---|---|
T | TBD |
Constructors
| Improve this Doc View SourceAtomicReference()
Default constructor
Declaration
public AtomicReference()
AtomicReference(T)
Sets the initial value of this AtomicReference<T> to originalValue
.
Declaration
public AtomicReference(T originalValue)
Parameters
Type | Name | Description |
---|---|---|
T | originalValue | TBD |
Fields
| Improve this Doc View SourceatomicValue
TBD
Declaration
protected T atomicValue
Field Value
Type | Description |
---|---|
T |
Properties
| Improve this Doc View SourceValue
The current value of this AtomicReference<T>
Declaration
public T Value { get; set; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceCompareAndSet(T, T)
If Value equals expected
, then set the Value to
newValue
.
Declaration
public bool CompareAndSet(T expected, T newValue)
Parameters
Type | Name | Description |
---|---|---|
T | expected | TBD |
T | newValue | TBD |
Returns
Type | Description |
---|---|
Boolean |
|
GetAndSet(T)
Declaration
public T GetAndSet(T newValue)
Parameters
Type | Name | Description |
---|---|---|
T | newValue | The new value |
Returns
Type | Description |
---|---|
T | The old value |
Operators
| Improve this Doc View SourceImplicit(AtomicReference<T> to T)
Performs an implicit conversion from AtomicReference<T> to T
.
Declaration
public static implicit operator T(AtomicReference<T> atomicReference)
Parameters
Type | Name | Description |
---|---|---|
AtomicReference<T> | atomicReference | The reference to convert |
Returns
Type | Description |
---|---|
T | The result of the conversion. |