Table of Contents

Class MicroThreadLocal<T>

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

Provides microthread-local storage of data.

public class MicroThreadLocal<T> where T : class

Type Parameters

T

Type of data stored.

Inheritance
MicroThreadLocal<T>

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

valueFactory Func<T>

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

Properties

IsValueCreated

public bool IsValueCreated { get; }

Property Value

bool

Value

Gets or sets the value for the current microthread.

public T Value { get; set; }

Property Value

T

The value for the current microthread.

Methods

ClearValue()

public void ClearValue()