Export (0) Print
Expand All

GetThreadPriority

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function returns the priority value for the specified thread.


int GetThreadPriority(
  HANDLE hThread
);

hThread

[in] Handle to the thread.

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

This function returns the base priority of the thread. If priority inheritance changes the priority of a thread, the value returned by this function might not match the original thread priority or the value assigned by SetThreadPriority.

The following table shows priority level values.

Priority level Description

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.

Aa909037.note(en-us,MSDN.10).gifNote:
Priority levels 0 through 7, available in earlier versions of Windows Embedded CE, are now mapped to priority levels 248 through 255.

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

When manipulating priorities, be sure a high-priority thread does not consume all available CPU time.

Threads are scheduled in a round-robin fashion at each priority level. Threads at a lower level are only scheduled when no executable threads exist at a higher level.

Aa909037.note(en-us,MSDN.10).gifNote:
In previous releases, a call to GetThreadPriority or CEGetThreadPriority would return the current thread's priority. The value returned might have been a priority boosted by priority inheritance.

For more information about priority levels in Windows Embedded CE, see Priority Levels.

Headerwinbase.h
Librarycoredll.lib
Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

ADD
Show:
© 2014 Microsoft