-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Threading_InterlockedOperations_Initialize__1
Andrew Koryavchenko edited this page Jun 17, 2018
·
8 revisions
Initialize the value referenced by target in a thread-safe manner. The value is changed to value only if the current value is default(T).
Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static T Initialize<T>(
ref T target,
T value
)
where T : class
VB
Public Shared Function Initialize(Of T As Class) (
ByRef target As T,
value As T
) As T
F#
static member Initialize :
target : 'T byref *
value : 'T -> 'T when 'T : not struct
- target
- Type: T
Reference to the target location. - value
- Type: T
The value to use if the target is equal to default(T).
- T
- Type of value.
Type: T
The new value referenced by target. Note that this is nearly always more useful than the usual return from CompareExchange(T)(T, T, T) because it saves another read to target.
InterlockedOperations Class
Initialize Overload
CodeJam.Threading Namespace