SemaphoreSlimExtensions.InLockAsync(TType) Method (SemaphoreSlim, Func(TType))

Tungsten Suite

SemaphoreSlimExtensionsInLockAsyncTType Method (SemaphoreSlim, FuncTType)

Asynchronously performs the function in a lock

Namespace:  W.Threading.Lockers
Assembly:  Tungsten.Threading.Lockers (in Tungsten.Threading.Lockers.dll) Version: 2.0.1
Syntax
C#
public static Task<TType> InLockAsync<TType>(
	this SemaphoreSlim this,
	Func<TType> func
)

Parameters

this
Type: System.ThreadingSemaphoreSlim
The SemaphoreSlim to provide resource locking
func
Type: SystemFuncTType
The function to perform

Type Parameters

TType

[Missing <typeparam name="TType"/> documentation for "M:W.Threading.Lockers.SemaphoreSlimExtensions.InLockAsync``1(System.Threading.SemaphoreSlim,System.Func{``0})"]

Return Value

Type: TaskTType

[Missing <returns> documentation for "M:W.Threading.Lockers.SemaphoreSlimExtensions.InLockAsync``1(System.Threading.SemaphoreSlim,System.Func{``0})"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SemaphoreSlim. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also