IReaderWriterStateLocker(TState).InLockAsync(TValue) Method (LockTypeEnum, Func(TState, TValue))

Tungsten Suite

IReaderWriterStateLockerTStateInLockAsyncTValue Method (LockTypeEnum, FuncTState, TValue)

Executes a function from within a ReaderWriterLockSlim

Namespace:  W.Threading.Lockers
Assembly:  Tungsten.Threading.Lockers (in Tungsten.Threading.Lockers.dll) Version: 2.0.1
Syntax
C#
Task<TValue> InLockAsync<TValue>(
	LockTypeEnum lockType,
	Func<TState, TValue> func
)

Parameters

lockType
Type: W.Threading.LockersLockTypeEnum
Specifies whether to use a Read or Write lock
func
Type: SystemFuncTState, TValue
The function to run

Type Parameters

TValue
The type of return value

Return Value

Type: TaskTValue
The result of the function call (a value of type TValue)
See Also