Export (0) Print
Expand All
Expand Minimize

SetThreadPriorityBoost function

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

Syntax


BOOL WINAPI SetThreadPriorityBoost(
  _In_  HANDLE hThread,
  _In_  BOOL DisablePriorityBoost
);

Parameters

hThread [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.

Windows Server 2003 and Windows XP:  The handle must have the THREAD_SET_INFORMATION access right.

DisablePriorityBoost [in]

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

Return value

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

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

Library

Kernel32.lib

DLL

Kernel32.dll

See also

GetThreadPriorityBoost
OpenThread
Priority Boosts
Process and Thread Functions
Scheduling Priorities
Threads

 

 

Community Additions

ADD
Show:
© 2014 Microsoft