ThreadingTools::ApplyChangeOptimistically<T> Method (T, Func<T, T>^)

 

Optimistically performs some value transformation based on some field and tries to apply it back to the field, retrying as many times as necessary until no other thread is manipulating the same field.

Namespace:   Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

public:
generic<typename T>
where T : ref class
static bool ApplyChangeOptimistically(
	T% hotLocation,
	Func<T, T>^ applyChange
)

Parameters

hotLocation
Type: T

The field that may be manipulated by multiple threads.

applyChange
Type: System::Func<TT>^

A function that receives the unchanged value and returns the changed value.

Return Value

Type: System::Boolean

Returns Boolean.

Type Parameters

T

The type of data.

Return to top
Show: