Class LockWrapper
- Namespace
- DuetControlServer.Model
- Assembly
- DuetControlServer.dll
Wrapper around the lock which notifies subscribers whenever an update has been processed. It is also able to detect the origin of model-related deadlocks
public sealed class LockWrapper : IDisposable
- Inheritance
-
LockWrapper
- Implements
- Inherited Members
Constructors
LockWrapper(IDisposable, bool, OnUpdatedHandler, IHostApplicationLifetime, ObjectModel, ILogger, IOptions<Settings>)
Constructor of the lock wrapper
public LockWrapper(IDisposable lockItem, bool isWriteLock, LockWrapper.OnUpdatedHandler onUpdated, IHostApplicationLifetime lifetime, ObjectModel model, ILogger logger, IOptions<Settings> settings)
Parameters
lockItemIDisposableActual lock
isWriteLockboolWhether the lock is a read/write lock
onUpdatedLockWrapper.OnUpdatedHandlerCallback to invoke when the model has been updated
lifetimeIHostApplicationLifetimeLifetime of the application
modelObjectModelObject model instance
loggerILoggerLogger instance
settingsIOptions<Settings>Settings of the application
Methods
Dispose()
Dispose method that is called when the lock is released
public void Dispose()