1
0
Files
irix-657m-src/eoe/man/man3p/pthread_setschedparam.3p
2022-09-29 17:59:04 +03:00

93 lines
1.9 KiB
Plaintext

'\"macro stdmacro
.\"
.\" ----------------
.TH pthread_setschedparam 3P
.\"
.\" ----------------
.SH NAME
pthread_setschedparam, pthread_getschedparam \- change thread scheduling
.\"
.\" ----------------
.Op c p a
.SH C SYNOPSIS
.nf
.ft 3
#include <pthread.h>
.HP
.ft 3
int pthread_setschedparam(pthread_t thread, int policy,
.br
const struct sched_param \(**param);
.HP
.ft 3
int pthread_getschedparam(pthread_t thread, int \(**opolicy,
.br
struct sched_param \(**oparam);
.
.ft 1
.fi
.Op
.\"
.\" ----------------
.SH DESCRIPTION
The
.IR pthread_setschedparam ()
function changes the scheduling policy and parameters of
the thread identified by
.I thread
to the values specified by
.I policy
and
.IR param .
Changing the scheduling characteristics of an existing thread
is similar to creating the thread with those attributes [see
.IR pthread_attr_setschedpolicy ()
and
.IR pthread_attr_setschedparam ()].
Only the assigned thread priority is changed \- a temporary priority
elevation obtained by acquiring a mutex is not affected [see
.IR pthread_mutexattr_setprotocol ()].
.\"
.PP
The
.IR pthread_getschedparam ()
function returns the scheduling policy and parameters of
the thread identified by
.I thread
via the
.I opolicy
and
.I oparam
parameters.
The assigned thread priority is returned in the
.I sched_priority
field of
.IR sched_param ;
the actual priority may be temporarily higher if the thread
is holding a priority elevating mutex.
.\"
.\" ----------------
.SH DIAGNOSTICS
On success
.IR pthread_setschedparam ()
and
.IR pthread_getschedparam ()
return zero; otherwise an error number is returned:
.\"
.TP 15
.B [ESRCH]
The
.I thread
parameter does not identify a thread.
.TP
.B [EPERM]
The caller lacks sufficient privilege to change the scheduling
attributes of
.IR thread .
.\"
.\" ----------------
.SH "SEE ALSO"
pthread_attr_setschedparam(3P),
pthread_attr_setschedpolicy(3P),
pthread_mutexattr_setprotocol(3P).