ThreadPool 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供对线程池的访问。 有关使用线程池的详细指导,请参阅线程 和异步编程 :
注意
桌面应用和 UWP 应用支持 ThreadPool API。
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 ThreadPoolPublic Class 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) | 创建一个工作项,指定其相对于线程池中其他工作项的优先级,并指定运行时间长的工作项。 |