Share via


GetThreadPriority

This function returns the priority value for the specified thread.

int GetThreadPriority( 
HANDLE hThread); 

Parameters

  • hThread
    Handle to the thread.

Return Values

The thread's priority level indicates success. THREAD_PRIORITY_ERROR_RETURN indicates failure. To get extended error information, call GetLastError.

This function returns the current thread priority. If a thread's priority was changed due to a priority inversion condition, the thread priority may not match its initial value or the value assigned by SetThreadPriority.

The thread's priority level is one of the values described in the following list.

THREAD_PRIORITY_TIME_CRITICAL

Indicates 3 points above normal priority.

THREAD_PRIORITY_HIGHEST

Indicates 2 points above normal priority.

  • THREAD_PRIORITY_ABOVE_NORMAL
    Indicates 1 point above normal priority.

THREAD_PRIORITY_NORMAL

Indicates normal priority. (251)

  • THREAD_PRIORITY_BELOW_NORMAL
    Indicates 1 point below normal priority.

THREAD_PRIORITY_LOWEST

Indicates 2 points below normal priority.

THREAD_PRIORITY_ABOVE_IDLE

Indicates 3 points below normal priority.

  • THREAD_PRIORITY_IDLE
    Indicates 4 points below normal priority.

Remarks

Windows CE does not support priority classes. The order in which threads are scheduled is determined only by their thread priorities.

When manipulating priorities, ensure that a high-priority thread does not consume all of the available CPU time.

Threads are scheduled in a round-robin fashion at each priority level, and only when there are no executable threads at a higher level will scheduling of threads at a lower level take place

In previous releases, a call to GetThreadPriority or CEGetThreadPriority would return the current thread's priority. This could have been the priority of a thread that had its priority boosted because of priority inversion. The base priority is no longer returned.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winbase.h   Coredll.lib, Nk.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, SetThreadPriority

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.