Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.IO.ILockProvider.LockResourceAsync Method

Locks a resource defined by key. The resource name is application-defined.

Class: YetaWF.Core.IO.ILockProvider
Namespace: YetaWF.Core.IO
Assembly: YetaWF.Core

Syntax

public Task<ILockObject> LockResourceAsync( string key );

Parameters

key

The resource name.

Return Value

Returns an lock object. This object must be disposed.

Remarks

Once the returned object is disposed, the lock is released. It is better to explicitly unlock the resource using the ILockObject.UnlockAsync method due to its async nature. The object must be disposed properly in all cases, even if the ILockObject.UnlockAsync method is called to unlock.

See Also YetaWF.Core.IO.ILockProvider ClassYetaWF.Core Overview