ThreadingTools::ApplyChangeOptimistically<T> Method (T, Func<T, T>^)
Visual Studio 2015
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.
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<T, T>^
A function that receives the unchanged value and returns the changed value.
Type Parameters
- T
The type of data.
Show: