Summer.Batch.Common.Util.AtomicTypes.IAtomic< T > Interface Template Reference
Provide atomic access to an instance of T . More...
Public Member Functions | |
void | LazySet (T newValue) |
Eventually sets to the given value. More... | |
bool | CompareAndSet (T expectedValue, T newValue) |
Atomically sets the value to the newValue if the current value equals the expectedValue . More... | |
bool | WeakCompareAndSet (T expectedValue, T newValue) |
Atomically sets the value to the newValue if the current value equals the expectedValue . May fail spuriously. More... | |
T | Exchange (T newValue) |
Atomically sets to the given value and returns the previous value. More... | |
string | ToString () |
Returns the String representation of the current value. More... | |
Properties | |
T | Value [get, set] |
Gets and sets the current value. More... | |
Detailed Description
Provide atomic access to an instance of T .
- Template Parameters
-
T The type of the instance to be updated atomically.
Member Function Documentation
bool Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.CompareAndSet | ( | T | expectedValue, |
T | newValue | ||
) |
Atomically sets the value to the newValue if the current value equals the expectedValue .
- Parameters
-
expectedValue The expected value newValue The new value to use of the current value equals the expected value.
- Returns
true
if the current value equaled the expected value,false
otherwise.
T Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.Exchange | ( | T | newValue | ) |
Atomically sets to the given value and returns the previous value.
- Parameters
-
newValue The new value for the instance.
- Returns
- the previous value of the instance.
void Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.LazySet | ( | T | newValue | ) |
Eventually sets to the given value.
- Parameters
-
newValue the new value
string Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.ToString | ( | ) |
Returns the String representation of the current value.
- Returns
- The String representation of the current value.
bool Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.WeakCompareAndSet | ( | T | expectedValue, |
T | newValue | ||
) |
Atomically sets the value to the newValue if the current value equals the expectedValue . May fail spuriously.
- Parameters
-
expectedValue The expected value newValue The new value to use of the current value equals the expected value.
- Returns
true
if the current value equaled the expected value,false
otherwise.
Property Documentation
|
getset |
Gets and sets the current value.
The documentation for this interface was generated from the following file:
- Summer.Batch.Common/Util/AtomicTypes/IAtomic.cs