tgstation-server 5.12.7
The /tg/station 13 server suite
Loading...
Searching...
No Matches
BridgeRegistration.cs
Go to the documentation of this file.
1using System;
2
4{
7 {
11 readonly object lockObject;
12
16 Action onDispose;
17
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
lock object for accessing onDispose.
BridgeRegistration(Action onDispose)
Initializes a new instance of the BridgeRegistration class.