-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Threading_InterlockedOperations_Initialize_3
Andrew Koryavchenko edited this page Jun 17, 2018
·
5 revisions
Initialize the value referenced by target in a thread-safe manner. The value is changed to initializedValue only if the current value is uninitializedValue.
Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static int Initialize(
ref int target,
int initializedValue,
int uninitializedValue
)
VB
Public Shared Function Initialize (
ByRef target As Integer,
initializedValue As Integer,
uninitializedValue As Integer
) As Integer
F#
static member Initialize :
target : int byref *
initializedValue : int *
uninitializedValue : int -> int
- target
- Type: System.Int32
Reference to the target location. - initializedValue
- Type: System.Int32
The value to use if the target is currently uninitialized. - uninitializedValue
- Type: System.Int32
The uninitialized value.
Type: Int32
The new value referenced by target. Note that this is nearly always more useful than the usual return from CompareExchange(Int32, Int32, Int32) because it saves another read to target.
InterlockedOperations Class
Initialize Overload
CodeJam.Threading Namespace