SetThreadPriorityBoost

Disables or enables the ability of the system to temporarily boost the priority of a thread.

Syntax

BOOL SetThreadPriorityBoost(
         HANDLE hThread,
         BOOL bDisablePriorityBoost
)  

Parameters

hThread
Type: HANDLE 

[in] A handle to the thread whose priority is to be boosted. The handle must have the THREAD_SET_INFORMATION or THREAD_SET_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights.

Note

  The handle must have the THREAD_SET_INFORMATION access right.

bDisablePriorityBoost
Type: BOOL 

[in]

If this parameter is TRUE, dynamic boosting is disabled. If the parameter is FALSE, dynamic boosting is enabled.

Return value

Type: BOOL 

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

When a thread is running in one of the dynamic priority classes, the system temporarily boosts the thread’s priority when it is taken out of a wait state. If SetThreadPriorityBoost is called with the DisablePriorityBoost parameter set to TRUE, the thread’s priority is not boosted. To restore normal behavior, call SetThreadPriorityBoost with DisablePriorityBoost set to FALSE.

Requirements

Header: Declared in processthreadsapi.h.

Library: Use kernelx.lib.