Class MainDomSemaphoreLock
Uses a system-wide Semaphore and EventWaitHandle to synchronize the current AppDomain
Inheritance
object
Namespace: Umbraco.Cms.Core.Runtime
Assembly: Umbraco.Core.dll
Syntax
public class MainDomSemaphoreLock : IMainDomLock
Constructors
View SourceMainDomSemaphoreLock(ILogger<MainDomSemaphoreLock>, IHostingEnvironment)
Declaration
public MainDomSemaphoreLock(ILogger<MainDomSemaphoreLock> logger, IHostingEnvironment hostingEnvironment)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<MainDomSemaphoreLock> | logger | |
| IHostingEnvironment | hostingEnvironment |
Methods
View SourceAcquireLockAsync(int)
Acquires an application-wide distributed lock
Declaration
public Task<bool> AcquireLockAsync(int millisecondsTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| int | millisecondsTimeout |
Returns
| Type | Description |
|---|---|
| Task<bool> | An awaitable boolean value which will be false if the elapsed millsecondsTimeout value is exceeded |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
ListenAsync()
Wait on a background thread to receive a signal from another AppDomain
Declaration
public Task ListenAsync()
Returns
| Type | Description |
|---|---|
| Task |