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.

INtime thread priority 0-2 masks all RT interrupts including the INtime system tick.

INtime thread priority 3-60 masks all RT interrupts with IDT vectors 224-239.

INtime thread priority 61-255 makss no RT interrupts.

Multiple MSI uses AllocateRtInterrupts() to allocate vectors in the range 96-223. Interrupts on these vectors are masked by threads with priority 0-128.

Note: priority 0 in INtime also blocks the scheduler and interrupts. Care should be taken when using this priority. INtime priorities 0-2 will block the INtime clock.Type your Note Box content here.

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