ThreadPool 类

定义

public ref class ThreadPool abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ThreadPool final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class ThreadPool
Public Class ThreadPool
继承
Object Platform::Object IInspectable ThreadPool
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

ThreadPool 类只有静态方法,因此无需创建类的实例即可调用其方法。

方法

RunAsync(WorkItemHandler)

创建工作项。

RunAsync(WorkItemHandler, WorkItemPriority)

创建一个工作项,并指定其相对于线程池中其他工作项的优先级。

RunAsync(WorkItemHandler, WorkItemPriority, WorkItemOptions)

创建一个工作项,指定其相对于线程池中其他工作项的优先级,并指定运行时间长的工作项。

适用于