|PTHREAD_ATTR_SETINHERITSCHED(3)||Linux Programmer's Manual||PTHREAD_ATTR_SETINHERITSCHED(3)|
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched); int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched);
Compile and link with -pthread.
The following scheduling attributes are affected by the inherit-scheduler attribute: scheduling policy (pthread_attr_setschedpolicy(3)), scheduling priority (pthread_attr_setschedparam(3)), and contention scope (pthread_attr_setscope(3)).
The following values may be specified in inheritsched:
- Threads that are created using attr inherit scheduling attributes from the creating thread; the scheduling attributes in attr are ignored.
- Threads that are created using attr take their scheduling attributes from the values specified by the attributes object.
The default setting of the inherit-scheduler attribute in a newly initialized thread attributes object is PTHREAD_INHERIT_SCHED.
The pthread_attr_getinheritsched() returns the inherit-scheduler attribute of the thread attributes object attr in the buffer pointed to by inheritsched.
- Invalid value in inheritsched.
POSIX.1 also documents an optional ENOTSUP error ("attempt was made to set the attribute to an unsupported value") for pthread_attr_setinheritsched().
|pthread_attr_setinheritsched (), pthread_attr_getinheritsched ()||Thread safety||MT-Safe|