Export (0) Print
Expand All
Expand Minimize

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 only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

WinBase.h on Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Threadpoolapiset.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

CloseThreadpoolCleanupGroup
CloseThreadpoolCleanupGroupMembers
SetThreadpoolCallbackCleanupGroup
Thread Pools

 

 

Community Additions

ADD
Show:
© 2014 Microsoft