Table of Contents

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

lockItem IDisposable

Actual lock

isWriteLock bool

Whether the lock is a read/write lock

onUpdated LockWrapper.OnUpdatedHandler

Callback to invoke when the model has been updated

lifetime IHostApplicationLifetime

Lifetime of the application

model ObjectModel

Object model instance

logger ILogger

Logger instance

settings IOptions<Settings>

Settings of the application

Methods

Dispose()

Dispose method that is called when the lock is released

public void Dispose()