CloseThreadpoolWork

Releases the specified work object.

Syntax

void CloseThreadpoolWork(
         PTP_WORK pwk
)  

Parameters

pwk
Type: PTP_WORK 

[in, out] A TP_WORK structure that defines the work object. The CreateThreadpoolWork function returns this structure.

Return value

None.

Remarks

The work object is freed immediately if there are no outstanding callbacks; otherwise, the work object is freed asynchronously after the outstanding callbacks complete.

If there is a cleanup group associated with the work object, it is not necessary to call this function; calling the CloseThreadpoolCleanupGroupMembers function releases the work, wait, and timer objects associated with the cleanup group.

Requirements

Header: Declared in threadpoolapiset.h.

Library: Use kernelx.lib.