Class LockExtensions
Extension methods to make locking easier.
Inheritance
System.Object
LockExtensions
Namespace: Volo.Abp.Threading
Assembly: Volo.Abp.Core.dll
Syntax
public static class LockExtensions : object
Methods
Locking(Object, Action)
Executes given action
by locking given source
object.
Declaration
public static void Locking(this object source, Action action)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | Source object (to be locked) |
Action | action | Action (to be executed) |
Locking<T>(T, Action<T>)
Executes given action
by locking given source
object.
Declaration
public static void Locking<T>(this T source, Action<T> action)
where T : class
Parameters
Type | Name | Description |
---|---|---|
T | source | Source object (to be locked) |
Action<T> | action | Action (to be executed) |
Type Parameters
Name | Description |
---|---|
T | Type of the object (to be locked) |
Locking<TResult>(Object, Func<TResult>)
Executes given func
and returns it's value by locking given source
object.
Declaration
public static TResult Locking<TResult>(this object source, Func<TResult> func)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | Source object (to be locked) |
Func<TResult> | func | Function (to be executed) |
Returns
Type | Description |
---|---|
TResult | Return value of the |
Type Parameters
Name | Description |
---|---|
TResult | Return type |
Locking<T, TResult>(T, Func<T, TResult>)
Executes given func
and returns it's value by locking given source
object.
Declaration
public static TResult Locking<T, TResult>(this T source, Func<T, TResult> func)
where T : class
Parameters
Type | Name | Description |
---|---|---|
T | source | Source object (to be locked) |
Func<T, TResult> | func | Function (to be executed) |
Returns
Type | Description |
---|---|
TResult | Return value of the |
Type Parameters
Name | Description |
---|---|
T | Type of the object (to be locked) |
TResult | Return type |