tgstation-server  4.4.0
The /tg/station 13 server suite
BridgeRegistration.cs
Go to the documentation of this file.
1 using System;
2 
3 namespace Tgstation.Server.Host.Components.Interop.Bridge
4 {
7  {
11  readonly object lockObject;
12 
16  Action onDispose;
17 
22  public BridgeRegistration(Action onDispose)
23  {
24  this.onDispose = onDispose ?? throw new ArgumentNullException(nameof(onDispose));
25  lockObject = new object();
26  }
27 
29  public void Dispose()
30  {
31  lock(lockObject)
32  {
33  onDispose?.Invoke();
34  onDispose = null;
35  }
36  }
37  }
38 }
readonly object lockObject
object for accessing onDispose.
Represents a registration of an interop session.
BridgeRegistration(Action onDispose)
Initializes a new instance of the BridgeRegistration .