[Previous] [Contents] [Next]

pthread_attr_setschedpolicy()

Set thread scheduling policy attribute

Synopsis:

#include <pthread.h>
#include <sched.h>

int pthread_attr_setschedpolicy(
                 pthread_attr_t* attr,
                 int policy );

Library:

libc

Description:

The pthread_attr_setschedpolicy() function sets the thread scheduling policy attribute in the thread attribute object attr to policy.

The thread scheduling policy attribute can have the following values:

SCHED_FIFO
First-In First-Out scheduling.
SCHED_RR
Round-Robin scheduling.
SCHED_OTHER
Currently the same as SCHED_RR.
SCHED_NOCHANGE
Don't change the policy.

The policy attribute is only used if you have set the thread inherit scheduling attribute to PTHREAD_EXPLICIT_SCHED using pthread_attr_setinheritsched().

Returns:

EOK
Success.
EINVAL
Invalid thread attribute object attr.
ENOTSUP
Invalid thread scheduling policy policy.

Classification:

POSIX 1003.1 (Threads)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pthread_attr_getschedpolicy(), pthread_attr_init(), pthread_create().


[Previous] [Contents] [Next]