pthread_attr_setinheritsched(3P) pthread_attr_setinheritsched(3P)
pthread_attr_setinheritsched, pthread_attr_getinheritsched - thread
scheduling inheritance attributes
#include <pthread.h>
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit);
int pthread_attr_getinheritsched(const pthread_attr_t *attr,
int *inherit);
By default, a newly created thread has its scheduling attributes
initialized from the attributes object used to create it (or from
defaults if none is specified) [see pthread_create()]. As an
alternative, the new thread may inherit the current scheduling attributes
from the thread which creates it. The scheduling attributes which may be
inherited are the scheduling policy [see pthread_attr_setschedpolicy()]
and scheduling parameters [see pthread_attr_setschedparam()].
The pthread_attr_setinheritsched() function sets the thread scheduling
inheritance attribute in the object attr to the value of inherit. The
value must be PTHREAD_INHERIT_SCHED if the attributes are to be inherited
or PTHREAD_EXPLICIT_SCHED if the attribute values are to be taken from
the object (this is the default). The current scheduling inheritance for
the attribute object attr, is returned via the inherit parameter of
pthread_attr_getinheritsched().
On success pthread_attr_setinheritsched() returns zero; otherwise an
error number is returned:
[EINVAL] The value of inherit is neither PTHREAD_INHERIT_SCHED nor
PTHREAD_EXPLICIT_SCHED.
pthread_attr_getinheritsched() always returns zero.
pthread_create(3P), pthread_attr_setschedpolicy(3P),
pthread_attr_setschedparam(3P)
PPPPaaaaggggeeee 1111 [ Back ]
|