CreateThreadpoolCleanupGroup function (threadpoolapiset.h)
Creates a cleanup group that applications can use to track one or more thread pool callbacks.
If the function succeeds, it returns a pointer to 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.
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.
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.
For an example, see Using the Thread Pool Functions.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|
|Header||threadpoolapiset.h (include Windows 7, Windows Server 2008 Windows Server 2008 R2, Windows.h)|