Table of Contents

Method GetOrInitWithLock

Namespace
MonoMod.Utils
Assembly
MonoMod.Utils.dll

GetOrInitWithLock<T>(ref T?, object, Func<T>)

public static T GetOrInitWithLock<T>(ref T? location, object @lock, Func<T> init) where T : class

Parameters

location T
lock object
init Func<T>

Returns

T

Type Parameters

T

GetOrInitWithLock<TParam, T>(ref T?, object, Func<TParam, T>, TParam)

public static T GetOrInitWithLock<TParam, T>(ref T? location, object @lock, Func<TParam, T> init, TParam param) where T : class

Parameters

location T
lock object
init Func<TParam, T>
param TParam

Returns

T

Type Parameters

TParam
T

GetOrInitWithLock<T>(ref T?, object, delegate*<T>)

public static T GetOrInitWithLock<T>(ref T? location, object @lock, delegate*<T> init) where T : class

Parameters

location T
lock object
init delegate*<T>

Returns

T

Type Parameters

T

Remarks

This overload may not work on some older Mono implementations, which do not have good function pointer support.

GetOrInitWithLock<T, TParam>(ref T?, object, delegate*<TParam, T>, TParam)

public static T GetOrInitWithLock<T, TParam>(ref T? location, object @lock, delegate*<TParam, T> init, TParam obj) where T : class

Parameters

location T
lock object
init delegate*<TParam, T>
obj TParam

Returns

T

Type Parameters

T
TParam

Remarks

This overload may not work on some older Mono implementations, which do not have good function pointer support.