Modifier

Partager via


ImmutableInterlocked.Update Method

Definition

Overloads

Update<T,TArg>(ImmutableArray<T>, Func<ImmutableArray<T>,TArg,ImmutableArray<T>>, TArg)

Mutates an immutable array in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

Update<T,TArg>(T, Func<T,TArg,T>, TArg)

Mutates a value in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

Update<T>(ImmutableArray<T>, Func<ImmutableArray<T>,ImmutableArray<T>>)

Mutates an immutable array in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

Update<T>(T, Func<T,T>)

Mutates a value in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

Update<T,TArg>(ImmutableArray<T>, Func<ImmutableArray<T>,TArg,ImmutableArray<T>>, TArg)

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Mutates an immutable array in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

public:
generic <typename T, typename TArg>
 static bool Update(System::Collections::Immutable::ImmutableArray<T> % location, Func<System::Collections::Immutable::ImmutableArray<T>, TArg, System::Collections::Immutable::ImmutableArray<T>> ^ transformer, TArg transformerArgument);
public static bool Update<T,TArg> (ref System.Collections.Immutable.ImmutableArray<T> location, Func<System.Collections.Immutable.ImmutableArray<T>,TArg,System.Collections.Immutable.ImmutableArray<T>> transformer, TArg transformerArgument);
static member Update : ImmutableArray * Func<System.Collections.Immutable.ImmutableArray<'T>, 'Arg, System.Collections.Immutable.ImmutableArray<'T>> * 'Arg -> bool
Public Shared Function Update(Of T, TArg) (ByRef location As ImmutableArray(Of T), transformer As Func(Of ImmutableArray(Of T), TArg, ImmutableArray(Of T)), transformerArgument As TArg) As Boolean

Type Parameters

T

The type of data in the immutable array.

TArg

The type of argument passed to the transformer.

Parameters

location
ImmutableArray<T>

The immutable array to be changed.

transformer
Func<ImmutableArray<T>,TArg,ImmutableArray<T>>

A function that produces the new array from the old. This function should be side-effect free, as it may run multiple times when races occur with other threads.

transformerArgument
TArg

The argument to pass to transformer.

Returns

true if the location's value is changed by applying the result of the transformer function; false if the location's value remained the same because the last invocation of transformer returned the existing value.

Applies to

Update<T,TArg>(T, Func<T,TArg,T>, TArg)

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Mutates a value in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

public:
generic <typename T, typename TArg>
 where T : class static bool Update(T % location, Func<T, TArg, T> ^ transformer, TArg transformerArgument);
public static bool Update<T,TArg> (ref T location, Func<T,TArg,T> transformer, TArg transformerArgument) where T : class;
static member Update : 'T * Func<'T, 'Arg, 'T (requires 'T : null and 'T : null)> * 'Arg -> bool (requires 'T : null)
Public Shared Function Update(Of T As Class, TArg As Class) (ByRef location As T, transformer As Func(Of T, TArg, T), transformerArgument As TArg) As Boolean

Type Parameters

T

The type of data.

TArg

The type of argument passed to the transformer.

Parameters

location
T

The variable or field to be changed, which may be accessed by multiple threads.

transformer
Func<T,TArg,T>

A function that mutates the value. This function should be side-effect free, as it may run multiple times when races occur with other threads.

transformerArgument
TArg

The argument to pass to transformer.

Returns

true if the location's value is changed by applying the result of the transformer function; false if the location's value remained the same because the last invocation of transformer returned the existing value.

Applies to

Update<T>(ImmutableArray<T>, Func<ImmutableArray<T>,ImmutableArray<T>>)

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Mutates an immutable array in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

public:
generic <typename T>
 static bool Update(System::Collections::Immutable::ImmutableArray<T> % location, Func<System::Collections::Immutable::ImmutableArray<T>, System::Collections::Immutable::ImmutableArray<T>> ^ transformer);
public static bool Update<T> (ref System.Collections.Immutable.ImmutableArray<T> location, Func<System.Collections.Immutable.ImmutableArray<T>,System.Collections.Immutable.ImmutableArray<T>> transformer);
static member Update : ImmutableArray * Func<System.Collections.Immutable.ImmutableArray<'T>, System.Collections.Immutable.ImmutableArray<'T>> -> bool
Public Shared Function Update(Of T) (ByRef location As ImmutableArray(Of T), transformer As Func(Of ImmutableArray(Of T), ImmutableArray(Of T))) As Boolean

Type Parameters

T

The type of data in the immutable array.

Parameters

location
ImmutableArray<T>

The immutable array to be changed.

transformer
Func<ImmutableArray<T>,ImmutableArray<T>>

A function that produces the new array from the old. This function should be side-effect free, as it may run multiple times when races occur with other threads.

Returns

true if the location's value is changed by applying the result of the transformer function; false if the location's value remained the same because the last invocation of transformer returned the existing value.

Applies to

Update<T>(T, Func<T,T>)

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Mutates a value in-place with optimistic locking transaction semantics via a specified transformation function. The transformation is retried as many times as necessary to win the optimistic locking race.

public:
generic <typename T>
 where T : class static bool Update(T % location, Func<T, T> ^ transformer);
public static bool Update<T> (ref T location, Func<T,T> transformer) where T : class;
static member Update : 'T * Func<'T, 'T (requires 'T : null and 'T : null)> -> bool (requires 'T : null)
Public Shared Function Update(Of T As Class) (ByRef location As T, transformer As Func(Of T, T)) As Boolean

Type Parameters

T

The type of data.

Parameters

location
T

The variable or field to be changed, which may be accessed by multiple threads.

transformer
Func<T,T>

A function that mutates the value. This function should be side-effect free, as it may run multiple times when races occur with other threads.

Returns

true if the location's value is changed by applying the result of the transformer function; false if the location's value remained the same because the last invocation of transformer returned the existing value.

Applies to