CreateThreadpoolCleanupGroup

Creates a cleanup group that applications can use to track one or more thread pool callbacks.

Syntax

PTP_CLEANUP_GROUP CreateThreadpoolCleanupGroup(
         VOID
)  

Parameters

Type: VOID 

kernelx.lib

Return value

Type: PTP_CLEANUP_GROUP 

If the function succeeds, it returns a TP_CLEANUP_GROUP structure of the newly allocated cleanup group. Applications do not modify the members of this structure.

If function fails, it returns NULL. To retrieve extended error information, call GetLastError.

Remarks

After creating the cleanup group, call SetThreadpoolCallbackCleanupGroup to associate the cleanup group with a callback environment.

A member is added to the group each time you call one of the following functions:

You use one of the following corresponding close functions to remove a member from the group.

To close all the callbacks, call CloseThreadpoolCleanupGroupMembers.

Requirements

Header: Declared in threadpoolapiset.h.

Library: Use kernelx.lib.