Index of Section 2 Manual Pages
| Interix / SUA | pthread_attr_getinheritsched.2 | Interix / SUA |
pthread_attr_getinheritsched(2) pthread_attr_getinheritsched(2)
pthread_attr_getinheritsched()
NAME
pthread_attr_getinheritsched(), pthread_attr_setinheritsched() - get or
set the thread scheduling-inheritance attribute
SYNOPSIS
#include
int pthread_attr_getinheritsched(const pthread_attr_t *attr, int
*inheritsched);
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched);
DESCRIPTION
The pthread_attr_setinheritsched(2) function sets the scheduling-
inheritance attribute in the thread attributes object referenced by attr
using the value of the inheritsched argument. The scheduling-inheritance
attribute determines how the other scheduling attributes of the thread
created using the attr object are set. When the inheritsched argument is
set to PTHREAD_INHERIT_SCHED, the thread scheduling attributes are
inherited from the parent thread, and the scheduling attributes in the
attr object are ignored. If the inheritsched argument is set to
PTHREAD_EXPLICIT_SCHED, the scheduling attributes of the created thread
are set according to the settings in the attr object used to create the
thread.
The following are the thread scheduling attributes controlled by the
scheduling-inheritance attribute:
* schedpolicy (scheduling policy)
* schedparam (scheduling parameters)
* contentionscope (scheduling contention scope)
After the attributes have been set in the thread attributes object
referenced by attr, the pthread_create(2) function can be called to create
a new thread with the specified attributes. This function does not affect
the current running thread.
The pthread_attr_getinheritsched(2) function retrieves the cheduling-
inheritance attribute in the attr thread attributes object, storing the
value in the location referenced by the inheritsched argument.
RETURN VALUES
On success, both functions return 0; otherwise, they return an error
number.
ERRORS
The pthread_attr_setinheritsched() function can fail for the following
reasons:
[EINVAL]
The inheritsched argument is not PTHREAD_INHERIT_SCHED or
PTHREAD_EXPLICIT_SCHED.
[ENOTSUP]
An attempt was made to set the cheduling-inheritance attribute to to
an unsupported value.
Neither function returns [EINTR].
SEE ALSO
pthread_attr_destroy(2)
pthread_attr_getschedpolicy(2)
pthread_attr_getschedparam(2)
pthread_attr_getscope(2)
pthread_create(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.