PreallocatedWorkItem.PreallocatedWorkItem(WorkItemHandler, WorkItemPriority) constructor

Applies to Windows and Windows Phone

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 PreallocatedWorkItem(
  WorkItemHandler handler, 
  WorkItemPriority priority
)

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

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:
© 2014 Microsoft