INtime SDK Help
SetRtThreadPriority
INtime SDK v6 > About INtime > INtime Kernel > Threads > SetRtThreadPriority

Dynamically changes the priority of a non-interrupt thread. The new value must not exceed the containing process' maximum priority.

CAUTION:   Threads can be pre-empted for long periods of time, and performance can degrade when a thread uses this system call to lower its own priority.
BOOLEAN SetRtThreadPriority(
    RTHANDLE hThread,    // handle for thread
    BYTE byPriority      // new priority 
);

Parameters

hThread
A handle for the thread whose priority you want to change.
byPriority
The thread's new priority. The value 0 (zero) specifies the maximum priority of the specified thread's containing process.

Return Values

TRUE
Success.
FALSE
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_LIMIT 0x0004
byPriority's priority value is higher (numerically smaller) than the maximum priority of the specified thread's containing process.
E_CONTEXT 0x0005
hThread specifies an interrupt thread. You cannot dynamically set the priority of an interrupt thread.
E_EXIST 0x0006
You used an invalid value for hThread.
E_TYPE 0x8002
hThread requires an RT handle for a thread.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also