Click or drag to resize

InterlockedCompareExchangeT(T, T, T) Method

Compares two instances of the specified reference type T for equality and,if they are equal, replaces one of them.

Namespace: Crestron.SimplSharp
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public static T CompareExchange<T>(
	ref T location1,
	T value,
	T comparand
)
where T : class

Parameters

location1  T
The destination, whose value is compared with comparand and possibly replaced.
value  T
The value that replaces the destination value if the comparison results in equality.
comparand  T
The value that is compared to the value at location1.

Type Parameters

T
The type to be used for location1, value, and comparand. This type must be a reference type.

Return Value

T
The original value in location1.
Exceptions
ExceptionCondition
NullReferenceExceptionaddress of location1 is a null pointer

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also