Allocates a new pool of threads to execute callbacks.
PTP_POOL CreateThreadpool(
_Reserved_ PVOID reserved
)
reserved
Type: Reserved PVOID
This parameter is reserved and must be NULL.
Type: PTP_POOL
If the function succeeds, it returns a TP_POOL structure representing the newly allocated thread pool. 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 new thread pool, you should call SetThreadpoolThreadMaximum to specify the maximum number of threads that the pool can allocate and SetThreadpoolThreadMinimum to specify the minimum number of threads available in the pool.
To use the pool, you must associate the pool with a callback environment. To create the callback environment, call InitializeThreadpoolEnvironment. Then, call SetThreadpoolCallbackPool to associate the pool with the callback environment.
To release the thread pool, call CloseThreadpool.
Header: Declared in threadpoolapiset.h.
Library: Use kernelx.lib.