Thread.ManagedThreadId 属性

定义

获取当前托管线程的唯一标识符。Gets a unique identifier for the current managed thread.

public:
 property int ManagedThreadId { int get(); };
public int ManagedThreadId { get; }
member this.ManagedThreadId : int
Public ReadOnly Property ManagedThreadId As Integer

属性值

一个整数,表示此托管线程的唯一标识符。An integer that represents a unique identifier for this managed thread.

注解

线程的 ManagedThreadId 属性值用于唯一标识该线程在其进程中。A thread's ManagedThreadId property value serves to uniquely identify that thread within its process.

ManagedThreadId 属性的值不会随时间而变化,即使托管公共语言运行时的非托管代码将线程作为纤程实现。The value of the ManagedThreadId property does not vary over time, even if unmanaged code that hosts the common language runtime implements the thread as a fiber.

适用于