RtSetThreadPriority

RtSetThreadPriority sets the priority value for the specified thread.

Syntax

Copy
BOOL RtSetThreadPriority(
    HANDLE hThread,
    int RtssPriority
);

Parameters

hThread

The thread whose priority value is to be set.

RtssPriority

A priority level from 0 to 127, where 127 identifies the highest priority thread.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE.

To get extended error information, call GetLastError.

Remarks

If RtSetThreadPriority is called for a thread that currently has ownership of any mutexes, an attempt to lower priority will be delayed until mutexes have been released. If the target thead is at a promoted priority that resulted from activation of a priority inversion protocol, the priority set by this call will be the native priority used at demotion time. Note that if RtSetThreadPriority is called to raise thread priority it will execute immediately, regardless of whether the thread owns any mutexes.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtapi.h rtkrnl.lib

See Also: