osGetThreadPri.3p 1.24 KB
.TH osGetThreadPri 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osGetThreadPri, osSetThreadPri, \- obtain, reassign priority of a thread
.SH SYNOPSIS
.nf
.Op c
#include <ultra64.h>
.sp .8v
void osGetThreadPri(OSThread \(**t);
.sp .8v
void osSetThreadPri(OSThread \(**t, OSPri pri);
.Op
\f1
.fi
.SH DESCRIPTION
The
.I osGetThreadPri
call returns the priority of the given thread
.IR t .
If
.I t
is NULL, then
.I osGetThreadPri
returns the priority of the invoking (currently running) thread.
.PP
The
.I osSetThreadPri
call sets the priority of thread
.I t
to the value
.IR pri .
If
.I t
is NULL,
then the priority of the current thread is set.
As with
.IR osCreateThread ,
the priority value should range from
.I OS_PRIORITY_IDLE
(0) to
.I OS_PRIORITY_APPMAX
(127).
.PP
If
.I t
is runnable or blocked waiting to send or receive a message,
it is a member of a priority ordered queue.
The
.I 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
.I osSetThreadPri
immediately yields the CPU and the thread
.I t
will be allowed to run.
.SH "SEE ALSO"
.IR osCreateThread (3P),
.IR osGetThreadId (3P),
.IR osStartThread (3P),
.IR osYieldThread (3P)