Class ReferenceCounted<T>
Represents consumer part of the resource which lifetime is managed by the reference counter in thread-safe manner.
Inherited Members
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public abstract class ReferenceCounted<T> where T : IDisposable
Type Parameters
| Name | Description |
|---|---|
| T | The type of the resource. |
Remarks
All instance methods are thread-safe.
Methods
View SourceAcquire()
Acquires the access to the resource.
Declaration
public ReferenceCounted<T>.Scope Acquire()
Returns
| Type | Description |
|---|---|
| ReferenceCounted<T>.Scope | The scope which guarantees the liveness of the resource. The caller must check IsValid property before accessing Value. |