Windows Dev Center

PreallocatedWorkItem.PreallocatedWorkItem(WorkItemHandler, WorkItemPriority) constructor

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.

Syntax


Public Sub New (
  handler As WorkItemHandler,  
  priority As WorkItemPriority 
)

Parameters

handler

Type: WorkItemHandler

Indicates the method that the preallocated work item will run.

priority

Type: WorkItemPriority

The priority of the work item relative to other work items in the thread pool. The value of this parameter can be Low, Normal, or High.

Remarks

In C++, make sure that methods used as WorkItemHandler delegates exhibit agile threading model behavior. Calling a non-agile method from a work item will cause a deadlock to occur.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

See also

PreallocatedWorkItem
PreallocatedWorkItem(WorkItemHandler)
PreallocatedWorkItem(WorkItemHandler, WorkItemPriority, WorkItemOptions)

 

 

Show:
© 2015 Microsoft