CreateThreadpoolCleanupGroup function
Creates a cleanup group that applications can use to track one or more thread pool callbacks.
Syntax
PTP_CLEANUP_GROUP WINAPI CreateThreadpoolCleanupGroup(void);
Parameters
This function has no parameters.
Return value
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.
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.
Examples
For an example, see Using the Thread Pool Functions.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- CloseThreadpoolCleanupGroup
- CloseThreadpoolCleanupGroupMembers
- SetThreadpoolCallbackCleanupGroup
- Thread Pools