ThreadPool.PendingWorkItemCount 属性

定义

获取当前已加入处理队列的工作项数。Gets the number of work items that are currently queued to be processed.

public:
 static property long PendingWorkItemCount { long get(); };
public static long PendingWorkItemCount { get; }
member this.PendingWorkItemCount : int64
Public Shared ReadOnly Property PendingWorkItemCount As Long

属性值

Int64

当前排队等候处理的工作项的数目。The number of work items that are currently queued to be processed.

注解

如果线程池实现可能具有不同类型的工作项,则计数将包括可以跟踪的所有类型,这些类型只能是用户工作项(包括任务)。If a thread pool implementation may have different types of work items, the count includes all types that can be tracked, which may only be the user work items, including tasks. 某些实现可能还包括队列中的计时器和等待回调。Some implementations may also include queued timer and wait callbacks in the count. 在 Windows 上,计数不太可能包含挂起的 IO 完成次数,因为它们直接发送到 IO 完成端口。On Windows, the count is unlikely to include the number of pending IO completions, because they are posted directly to an IO completion port.

适用于