Skip to content

M_CodeJam_Threading_InterlockedOperations_Update_2

andrewvk edited this page Apr 20, 2016 · 6 revisions

InterlockedOperations.Update Method (Int32, Func(Int32, Int32))

[This is preliminary documentation and is subject to change.]

Implements lock-free update pattern implementation based on compare-and-swap loop

Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static int Update(
	ref int value,
	Func<int, int> updateCallback
)

VB

Public Shared Function Update ( 
	ByRef value As Integer,
	updateCallback As Func(Of Integer, Integer)
) As Integer

F#

static member Update : 
        value : int byref * 
        updateCallback : Func<int, int> -> int 

Parameters

 

value
Type: System.Int32
[Missing documentation for "M:CodeJam.Threading.InterlockedOperations.Update(System.Int32@,System.Func{System.Int32,System.Int32})"]
updateCallback
Type: System.Func(Int32, Int32)
[Missing documentation for "M:CodeJam.Threading.InterlockedOperations.Update(System.Int32@,System.Func{System.Int32,System.Int32})"]

Return Value

Type: Int32
[Missing documentation for "M:CodeJam.Threading.InterlockedOperations.Update(System.Int32@,System.Func{System.Int32,System.Int32})"]

Remarks

Uses the same approach that used by c# compiler in event subscription methods

See Also

Reference

InterlockedOperations Class
Update Overload
CodeJam.Threading Namespace

Clone this wiki locally