PropertyCollection.CompareExchange<T>(Object, T, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Compares the entry associated with key
for equality with value and, if they are Equals(Object, Object),
replaces the entry with value
. This is done as a thread-safe/atomic operation.
public T CompareExchange<T> (object key, T value, T comparand);
member this.CompareExchange : obj * 'T * 'T -> 'T
Public Function CompareExchange(Of T) (key As Object, value As T, comparand As T) As T
Type Parameters
- T
Parameters
- key
- Object
- value
- T
- comparand
- T
Returns
T
The original entry associated with key
.
Remarks
If no value was associated with key
, then default(T
) is used.