INtime SDK Help
SetThreadPriority, RtSetThreadPriority (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > SetThreadPriority, RtSetThreadPriority (iwin32)

Sets the priority value for the specified thread.

For SetThreadPriority, specify the priority in the Win32 priority range (THREAD_PRIORITY_IDLE to THREAD_PRIORITY_TIME_CRITICAL).

For RtSetThreadPriority, specify the RTX priority (0 to 127).

BOOLEAN SetThreadPriority(
    HANDLE hThread,
    int nPriority
);

BOOLEAN RtSetThreadPriority(
    HANDLE hThread,
    int nPriority
);

Parameters

hThread
Handle to the thread whose priority value you want set.
nPriority
The thread's priority value.

Remarks

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

To get the priority value of a thread, use GetThreadPriority.

For more information about priorities, see Priorities.

Return Values

Non-zero
Success.
0 (zero)
Failure. For extended error information, see GetLastError.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h
intime/rt/include/winbase.h
iwin32.h
windows.h
iwin32.lib

Note

This function operates in the real-time portion of your application.

   
See Also