Table of Contents

Class LockExtensions

Namespace
Volo.Abp.Threading
Assembly
Volo.Abp.Core.dll

Extension methods to make locking easier.

public static class LockExtensions
Inheritance
LockExtensions
Inherited Members

Methods

Locking(object, Action)

Executes given action by locking given source object.

public static void Locking(this object source, Action action)

Parameters

source object

Source object (to be locked)

action Action

Action (to be executed)

Locking<TResult>(object, Func<TResult>)

Executes given func and returns it's value by locking given source object.

public static TResult Locking<TResult>(this object source, Func<TResult> func)

Parameters

source object

Source object (to be locked)

func Func<TResult>

Function (to be executed)

Returns

TResult

Return value of the func

Type Parameters

TResult

Return type

Locking<T>(T, Action<T>)

Executes given action by locking given source object.

public static void Locking<T>(this T source, Action<T> action) where T : class

Parameters

source T

Source object (to be locked)

action Action<T>

Action (to be executed)

Type Parameters

T

Type of the object (to be locked)

Locking<T, TResult>(T, Func<T, TResult>)

Executes given func and returns it's value by locking given source object.

public static TResult Locking<T, TResult>(this T source, Func<T, TResult> func) where T : class

Parameters

source T

Source object (to be locked)

func Func<T, TResult>

Function (to be executed)

Returns

TResult

Return value of the

Type Parameters

T

Type of the object (to be locked)

TResult

Return type