Search Results for

    Show / Hide Table of Contents

    Class Shared

    Shared resource utility.

    Inheritance
    System.Object
    Shared
    Namespace: Microsoft.Psi
    Assembly: Microsoft.Psi.dll
    Syntax
    public static class Shared : object

    Methods

    View Source

    Create<T>(T)

    Creates a Shared<T> instance wrapping the specified resource. The returned instance must be disposed.

    Declaration
    public static Shared<T> Create<T>(T resource)
        where T : class
    Parameters
    Type Name Description
    T resource

    The resource to wrap. Usually a large memory allocation.

    Returns
    Type Description
    Shared<T>

    A Shared<T> instance wrapping the specified resource.

    Type Parameters
    Name Description
    T

    The type of resource being wrapped.

    Remarks

    The reference count of the resource is incremented before this method returns. When the returned Shared<T> is disposed, resource's reference count is decremented. When the reference count reaches 0, the wrapped resource is released and disposed.

    • View Source
    In This Article
    • Methods
      • Create<T>(T)
    Back to top Privacy & Cookies | Terms Of Use | Trademarks | © Microsoft
    Generated by DocFX