-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Threading_InterlockedOperations_Update_5
Andrew Koryavchenko edited this page Jun 17, 2018
·
6 revisions
Implements lock-free update pattern implementation based on compare-and-swap loop
Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static long Update(
ref long value,
long newValue,
Func<long, long, long> updateCallback
)
VB
Public Shared Function Update (
ByRef value As Long,
newValue As Long,
updateCallback As Func(Of Long, Long, Long)
) As Long
F#
static member Update :
value : int64 byref *
newValue : int64 *
updateCallback : Func<int64, int64, int64> -> int64
- value
- Type: System.Int64
Value to change. - newValue
- Type: System.Int64
Precalculated new value. - updateCallback
- Type: System.Func(Int64, Int64, Int64)
Function to calculate new value.
Type: Int64
New value.
Uses the same approach that used by c# compiler in event subscription methods
InterlockedOperations Class
Update Overload
CodeJam.Threading Namespace