Nito.Disposables.ReferenceCountedDisposable
A reference-counted wrapper for a disposable. The wrapper itself is the first reference.
Once all references are disposed, the underlying disposable is disposed. All future reference disposals are no-ops.
Whether the wrapped disposable is disposed (finished disposing).
Whether the wrapped disposable is currently disposing or has been disposed.
Whether the wrapped disposable is currently disposing, but not finished yet.
Creates a reference-counted wrapper for the specified disposable.
Increments the reference count and returns a disposable that decrements the reference count when disposed.
The returned disposable may be disposed multiple times; it will only decrement the reference count once.
Frees the reference count held by this wrapper instance.