Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    MicroThreadLocal<T> Class

    Namespace: Stride.Core.MicroThreading
    Assembly: Stride.Core.MicroThreading.dll

    Provides microthread-local storage of data.

    System.Object → MicroThreadLocal<T>
    Derived from MicroThreadLocal<T>:

    public class MicroThreadLocal<T>
        where T : class
    Type Parameters
    Name Description
    T

    Type of data stored.

    Name Description
    Constructors
    MicroThreadLocal()

    Initializes a new instance of the MicroThreadLocal<T> class.

    MicroThreadLocal(Func<T>)

    Initializes a new instance of the MicroThreadLocal<T> class.

    Properties
    IsValueCreated
    Value

    Gets or sets the value for the current microthread.

    Methods
    ClearValue()
    | Improve this Doc View Source

    Constructors


    MicroThreadLocal()

    Initializes a new instance of the MicroThreadLocal<T> class.

    public MicroThreadLocal()

    MicroThreadLocal(Func<T>)

    Initializes a new instance of the MicroThreadLocal<T> class.

    public MicroThreadLocal(Func<T> valueFactory)
    Parameters
    Type Name Description
    System.Func<T> valueFactory

    The value factory invoked to create a value when Value is retrieved before having been previously initialized.

    | Improve this Doc View Source

    Properties


    IsValueCreated

    public bool IsValueCreated { get; }
    Property Value
    Type Description
    System.Boolean

    Value

    Gets or sets the value for the current microthread.

    public T Value { get; set; }
    Property Value
    Type Description
    T

    The value for the current microthread.

    | Improve this Doc View Source

    Methods


    ClearValue()

    public void ClearValue()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation