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...
 
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

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.
Author
Kenneth Xu

Member Function Documentation

bool Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.CompareAndSet ( expectedValue,
newValue 
)

Atomically sets the value to the newValue if the current value equals the expectedValue .

Parameters
expectedValueThe expected value
newValueThe 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 ( newValue)

Atomically sets to the given value and returns the previous value.

Parameters
newValueThe new value for the instance.
Returns
the previous value of the instance.
void Summer.Batch.Common.Util.AtomicTypes.IAtomic< T >.LazySet ( newValue)

Eventually sets to the given value.

Parameters
newValuethe new value

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 ( expectedValue,
newValue 
)

Atomically sets the value to the newValue if the current value equals the expectedValue . May fail spuriously.

Parameters
expectedValueThe expected value
newValueThe 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

Gets and sets the current value.


The documentation for this interface was generated from the following file:
  • Summer.Batch.Common/Util/AtomicTypes/IAtomic.cs