SetThreadpoolAffinityMask

Sets the affinity mask for the threads in the pool.

Syntax

BOOL SetThreadpoolAffinityMask(
         PTP_POOL ptpp,
         DWORD_PTR affinityMask
)  

Parameters

ptpp
Type: PTP_POOL 

[in, out] A TP_POOL structure that defines the thread pool. The CreateThreadpool function returns this structure.

affinityMask
Type: DWORD_PTR 

[in] The thread affinity mask.

Return value

Type: BOOL 

Indicates whether the thread affinity was successfully set. If the function succeeds the return value is TRUE. If the function fails, the return value is FALSE.

Remarks

The affinity doesn’t apply to already running work items. Worker threads will adjust their affinity mask when picking up the next work item.

Requirements

Header: Declared in threadpoolapiset.h.

Library: Use kernelx.lib.