此页面有用吗?
您对此内容的反馈非常重要。 请告诉我们您的想法。
更多反馈?
1500 个剩余字符
导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

PreallocatedWorkItem Class

预分配的工作项在其被提交到线程池中之前构造,这确保构造了工作项,以便可在必要时将其提交到线程池。例如,可在资源释放例程需要时创建 PreallocatedWorkItem,因为当可用于创建工作项的资源不足时,可能会调用资源释放例程。

注意  桌面和 Windows 应用商店应用程序均支持 ThreadPool API。

语法


public sealed class PreallocatedWorkItem

特性

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

成员

PreallocatedWorkItem类 具有这些类型的成员:

构造函数

PreallocatedWorkItem类 具有这些构造函数。

构造函数说明
PreallocatedWorkItem(WorkItemHandler) Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance.
PreallocatedWorkItem(WorkItemHandler, WorkItemPriority) Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool.
PreallocatedWorkItem(WorkItemHandler, WorkItemPriority, WorkItemOptions) Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool. Also specifies how the thread pool will allocate processor time for the work item.

 

方法

The PreallocatedWorkItem 类 具有这些方法。 它还继承方法于Object 类.

方法说明
RunAsync Submits the preallocated work item to the thread pool, without requiring any additional resources to be allocated.

 

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

最低支持电话

Windows Phone 8

命名空间

Windows.System.Threading.Core
Windows::System::Threading::Core [C++]

元数据

Windows.winmd

另请参见

Object

 

 

显示:
© 2015 Microsoft