Skip to content

M_CodeJam_Threading_InterlockedOperations_Initialize_6

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

InterlockedOperations.Initialize Method (Single, Single)

Initialize the value referenced by target in a thread-safe manner. The value is changed to value only if the current value is default(float).

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

Syntax

C#

public static float Initialize(
	ref float target,
	float value
)

VB

Public Shared Function Initialize ( 
	ByRef target As Single,
	value As Single
) As Single

F#

static member Initialize : 
        target : float32 byref * 
        value : float32 -> float32 

Parameters

 

target
Type: System.Single
Reference to the target location.
value
Type: System.Single
The value to use if the target is equal to default(float).

Return Value

Type: Single
The new value referenced by target. Note that this is nearly always more useful than the usual return from CompareExchange(Single, Single, Single) because it saves another read to target.

See Also

Reference

InterlockedOperations Class
Initialize Overload
CodeJam.Threading Namespace

Clone this wiki locally