InitializeThreadpoolEnvironment function

Initializes a callback environment.

Syntax

void InitializeThreadpoolEnvironment(
  PTP_CALLBACK_ENVIRON pcbe
);

Parameters

pcbe

A TP_CALLBACK_ENVIRON structure that defines a callback environment.

Return Value

This function does not return a value.

Remarks

By default, a callback executes in the default thread pool for the process. No cleanup group is associated with the callback environment, the caller is responsible for keeping the callback's DLL loaded while there are outstanding callbacks, and the callback is expected to run in a reasonable amount of time for the application.

Create a callback environment if you plan to call one of the following functions to modify the environment:

To use the default callback environment, set the optional callback environment parameter to NULL when calling one of the following functions: The InitializeThreadpoolEnvironment function is implemented as an inline function.

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 | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)

See Also

DestroyThreadpoolEnvironment

SetThreadpoolCallbackCleanupGroup

SetThreadpoolCallbackLibrary

SetThreadpoolCallbackPool

SetThreadpoolCallbackRunsLong

Thread Pools