Show / Hide Table of Contents

Class ReferenceCounted<T>

Represents consumer part of the resource which lifetime is managed by the reference counter in thread-safe manner.

Inheritance
object
ReferenceCounted<T>
ReferenceCountedOwner<T>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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 Source

Acquire()

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.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾