Class LockExtensions
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
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
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
TSource 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
TSource 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