osGetThreadPri osGetThreadPri (function)

osGetThreadPri, osSetThreadPri

Gets/sets the priority of the given thread

Syntax

include <ultra64.h>     /* ultra64.h
void osGetThreadPri(OSThread *t);
void osSetThreadPri(OSThread *t, OSPri pri);

Description

The osGetThreadPri call returns the priority of the given thread specified by the t argument. If t is NULL, osGetThreadPri returns the priority of the invoking (currently running) thread. The osSetThreadPri call sets the priority of thread specified by the t argument to the value specified by the pri argument. If t is NULL, then the priority of the current thread is set. As with osCreateThread, the priority value should range from OS_PRIORITY_IDLE (0) to OS_PRIORITY_APPMAX (127).

If t is runnable or blocked waiting to send or receive a message, it is a member of a priority-ordered queue. The osSetThreadPri call may cause the queue to be reordered to reflect the change in priority. In addition, if the thread becomes the highest priority runnable thread, the caller of osSetThreadPri immediately yields the CPU and the thread t will be allowed to run.

See Also

osCreateThread, osGetThreadId, osStartThread, and osYieldThread

Revision History

1999/04/30 Changed Format