thr_setprio(3T)
NAME
thr_setprio, thr_getprio − set/get a thread priority
SYNOPSIS
#include <thread.h>
int thr_setprio(thread_t target_thread, int pri);
int thr_getprio(thread_t target_thread, int ∗pri);
MT-LEVEL
MT-Safe
DESCRIPTION
Each thread has a priority which it inherits from its creator. thr_setprio() changes the priority of the thread, specified by target_thread, within the current process to the priority specified by pri. By default, threads are scheduled based on fixed priorities that range from zero, the least significant, to the largest integer. The target_thread will preempt lower priority threads, and will yield to higher priority threads.
The function thr_getprio() stores the current priority for the thread specified by target_thread in the location pointed to by pri.
RETURN VALUES
Zero is returned when successful. A non-zero value indicates error.
ERRORS
If any of the following conditions occur, thr_setprio() and thr_getprio() fail and return the corresponding value:
ESRCH target_thread cannot be found in the current process.
If any of the following conditions occur, thr_setprio() fails and returns the corresponding value:
EINVAL The value of pri makes no sense for the target_thread.
SEE ALSO
SunOS 5.2 — Last change: 22 Jan 1993