Index of Section 2 Manual Pages
| Interix / SUA | pthread_attr_setschedpolicy.2 | Interix / SUA |
pthread_attr_setschedpolicy(2) pthread_attr_setschedpolicy(2)
pthread_attr_getschedpolicy()
NAME
pthread_attr_getschedpolicy(), pthread_attr_setschedpolicy() - get or set
the thread scheduling policy attribute
SYNOPSIS
#include
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy);
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
DESCRIPTION
The pthread_attr_setschedpolicy(2) function sets the scheduling policy
attribute of the thread attributes object referenced by attr using the
value of the policy argument, which can be set to any of the following
values:
* SCHED_FIFO: Run to completion
* SCHED_RR: Round-robin
* SCHED_OTHER: Use scheduling values set by
pthread_attr_setschedparam(2)
Threads that are executing with the SCHED_FIFO or SCHED_RR scheduling
policy and that are waiting on a mutex acquire the mutex in priority order
when the mutex is unlocked.
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_getschedparam(2) function retrieves the scheduling policy
attribute in the thread attributes object referenced by attr, storing the
value in the location referenced by the policy argument.
RETURN VALUES
On success, both functions return 0; otherwise, they return an error
number.
ERRORS
The pthread_attr_setschedpolicy(2) function can fail for the following
reasons:
[EINVAL]
The policy argument is invalid.
[ENOTSUP]
An attempt was made to set the scheduling policy attribute to an
unsupported value.
SEE ALSO
pthread_attr_destroy(2)
pthread_attr_getinheritsched(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.