共用方式為


ThreadPool.RunAsync 方法

定義

多載

RunAsync(WorkItemHandler)

建立工作專案。

RunAsync(WorkItemHandler, WorkItemPriority)

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

RunAsync(WorkItemHandler, WorkItemPriority, WorkItemOptions)

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

RunAsync(WorkItemHandler)

建立工作專案。

public:
 static IAsyncAction ^ RunAsync(WorkItemHandler ^ handler);
/// [Windows.Foundation.Metadata.Overload("RunAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncAction RunAsync(WorkItemHandler const& handler);
[Windows.Foundation.Metadata.Overload("RunAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncAction RunAsync(WorkItemHandler handler);
function runAsync(handler)
Public Shared Function RunAsync (handler As WorkItemHandler) As IAsyncAction

參數

handler
WorkItemHandler

當執行緒可供執行工作專案時呼叫的方法。

傳回

IAsyncAction介面,提供工作專案的存取權。

屬性

另請參閱

適用於

RunAsync(WorkItemHandler, WorkItemPriority)

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

public:
 static IAsyncAction ^ RunAsync(WorkItemHandler ^ handler, WorkItemPriority priority);
/// [Windows.Foundation.Metadata.Overload("RunWithPriorityAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncAction RunAsync(WorkItemHandler const& handler, WorkItemPriority const& priority);
[Windows.Foundation.Metadata.Overload("RunWithPriorityAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncAction RunAsync(WorkItemHandler handler, WorkItemPriority priority);
function runAsync(handler, priority)
Public Shared Function RunAsync (handler As WorkItemHandler, priority As WorkItemPriority) As IAsyncAction

參數

handler
WorkItemHandler

當執行緒可供執行工作專案時呼叫的方法。

priority
WorkItemPriority

工作專案相對於執行緒集區中其他工作專案的優先順序。 此參數的值可以是 LowNormalHigh

傳回

IAsyncAction介面,提供工作專案的存取權。

屬性

另請參閱

適用於

RunAsync(WorkItemHandler, WorkItemPriority, WorkItemOptions)

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

public:
 static IAsyncAction ^ RunAsync(WorkItemHandler ^ handler, WorkItemPriority priority, WorkItemOptions options);
/// [Windows.Foundation.Metadata.Overload("RunWithPriorityAndOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncAction RunAsync(WorkItemHandler const& handler, WorkItemPriority const& priority, WorkItemOptions const& options);
[Windows.Foundation.Metadata.Overload("RunWithPriorityAndOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncAction RunAsync(WorkItemHandler handler, WorkItemPriority priority, WorkItemOptions options);
function runAsync(handler, priority, options)
Public Shared Function RunAsync (handler As WorkItemHandler, priority As WorkItemPriority, options As WorkItemOptions) As IAsyncAction

參數

handler
WorkItemHandler

當執行緒可供執行工作專案時呼叫的方法。

priority
WorkItemPriority

工作專案相對於執行緒集區中其他工作專案的優先順序。

options
WorkItemOptions

如果此參數為 TimeSliced,工作專案會與其他時間配量的工作專案同時執行,而每個工作專案都會收到處理器時間的共用。 如果此參數為 None,工作專案會在背景工作執行緒變成可用時執行。

傳回

IAsyncAction介面,提供工作專案的存取權。

屬性

另請參閱

適用於