CeSetThreadPriority (Windows Embedded CE 6.0)

1/6/2010

This function sets the priority for a real-time thread on a thread-by-thread basis.

Syntax

BOOL CeSetThreadPriority(
  HANDLE hThread,
  int nPriority
);

Parameters

  • hThread
    [in] Handle to a thread.
  • nPriority
    [in] Priority to set for the thread.

    This value can range from zero through 255, with zero as the highest priority. The following list shows the symbolic names for some values of nPriority:

    • CE_THREAD_PRIO_256_TIME_CRITICAL
    • CE_THREAD_PRIO_256_HIGHEST
    • CE_THREAD_PRIO_256_ABOVE_NORMAL
    • CE_THREAD_PRIO_256_NORMAL
    • CE_THREAD_PRIO_256_BELOW_NORMAL
    • CE_THREAD_PRIO_256_LOWEST
    • CE_THREAD_PRIO_256_ABOVE_IDLE
    • CE_THREAD_PRIO_256_IDLE

Return Value

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError.

Remarks

When the priority of a blocked thread is increased, the change takes effect immediately.

When the priority of a blocked thread is decreased, the change does not take effect until the thread is no longer blocked.

The following list shows the symbolic priority names provided for SetThreadPriority, which must not be used with CeSetThreadPriority:

  • THREAD_PRIORITY_TIME_CRITICAL
  • THREAD_PRIORITY_HIGHEST
  • THREAD_PRIORITY_ABOVE_NORMAL
  • THREAD_PRIORITY_NORMAL
  • THREAD_PRIORITY_BELOW_NORMAL
  • THREAD_PRIORITY_LOWEST
  • THREAD_PRIORITY_ABOVE_IDLE
  • THREAD_PRIORITY_IDLE

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

Requirements

Header winbase.h
Library Nk.lib
Windows Embedded CE Windows CE 3.0 and later

See Also

Reference

Process and Thread Functions
CeGetThreadPriority
SetThreadPriority