共用方式為


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)

建立工作專案、指定其相對於執行緒集區中其他工作專案的優先順序,並指定應該執行多久的工作專案。

適用於