posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
_POSIX_THREAD_PRIORITY_SCHEDULING

POSIX Thread Priority Scheduling option. More...

Macros

#define PTHREAD_EXPLICIT_SCHED   1
 Thread uses an explicitly provided scheduling policy.
 
#define PTHREAD_INHERIT_SCHED   0
 Thread inherits the scheduling policy of its creator (default).
 
#define PTHREAD_SCOPE_PROCESS   1
 Thread competes for resources only with threads in the same process.
 
#define PTHREAD_SCOPE_SYSTEM   0
 Thread competes for resources with all threads in the system (default).
 

Functions

int pthread_attr_getinheritsched (const pthread_attr_t *ZRESTRICT attr, int *ZRESTRICT inheritsched)
 Get the inherit-scheduler attribute of a thread attributes object.
 
int pthread_attr_getschedpolicy (const pthread_attr_t *ZRESTRICT attr, int *ZRESTRICT policy)
 Get the scheduling policy attribute of a thread attributes object.
 
int pthread_attr_getscope (const pthread_attr_t *ZRESTRICT attr, int *ZRESTRICT contentionscope)
 Get the contention scope attribute of a thread attributes object.
 
int pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched)
 Set the inherit-scheduler attribute of a thread attributes object.
 
int pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy)
 Set the scheduling policy attribute of a thread attributes object.
 
int pthread_attr_setscope (pthread_attr_t *attr, int contentionscope)
 Set the contention scope attribute of a thread attributes object.
 
int pthread_getschedparam (pthread_t thread, int *ZRESTRICT policy, struct sched_param *ZRESTRICT param)
 Get the scheduling policy and parameters of a thread.
 
int pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param)
 Set the scheduling policy and parameters of a thread.
 
int pthread_setschedprio (pthread_t thread, int prio)
 Set the scheduling priority of a thread.
 

Detailed Description

POSIX Thread Priority Scheduling option.

Macro Definition Documentation

◆ PTHREAD_EXPLICIT_SCHED

#define PTHREAD_EXPLICIT_SCHED   1

Thread uses an explicitly provided scheduling policy.

Definition at line 53 of file pthread.h.

◆ PTHREAD_INHERIT_SCHED

#define PTHREAD_INHERIT_SCHED   0

Thread inherits the scheduling policy of its creator (default).

Definition at line 55 of file pthread.h.

◆ PTHREAD_SCOPE_PROCESS

#define PTHREAD_SCOPE_PROCESS   1

Thread competes for resources only with threads in the same process.

Definition at line 90 of file pthread.h.

◆ PTHREAD_SCOPE_SYSTEM

#define PTHREAD_SCOPE_SYSTEM   0

Thread competes for resources with all threads in the system (default).

Definition at line 92 of file pthread.h.

Function Documentation

◆ pthread_attr_getinheritsched()

int pthread_attr_getinheritsched ( const pthread_attr_t *ZRESTRICT  attr,
int *ZRESTRICT  inheritsched 
)

Get the inherit-scheduler attribute of a thread attributes object.

Parameters
attrThread attributes object.
inheritschedOutput: PTHREAD_INHERIT_SCHED or PTHREAD_EXPLICIT_SCHED.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getinheritsched.html

◆ pthread_attr_getschedpolicy()

int pthread_attr_getschedpolicy ( const pthread_attr_t *ZRESTRICT  attr,
int *ZRESTRICT  policy 
)

Get the scheduling policy attribute of a thread attributes object.

Parameters
attrThread attributes object.
policyOutput: SCHED_FIFO, SCHED_RR, or SCHED_OTHER.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getschedpolicy.html

◆ pthread_attr_getscope()

int pthread_attr_getscope ( const pthread_attr_t *ZRESTRICT  attr,
int *ZRESTRICT  contentionscope 
)

Get the contention scope attribute of a thread attributes object.

Parameters
attrThread attributes object.
contentionscopeOutput: PTHREAD_SCOPE_SYSTEM or PTHREAD_SCOPE_PROCESS.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getscope.html

◆ pthread_attr_setinheritsched()

int pthread_attr_setinheritsched ( pthread_attr_t attr,
int  inheritsched 
)

Set the inherit-scheduler attribute of a thread attributes object.

Parameters
attrThread attributes object.
inheritschedPTHREAD_INHERIT_SCHED or PTHREAD_EXPLICIT_SCHED.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setinheritsched.html

◆ pthread_attr_setschedpolicy()

int pthread_attr_setschedpolicy ( pthread_attr_t attr,
int  policy 
)

Set the scheduling policy attribute of a thread attributes object.

Parameters
attrThread attributes object.
policySCHED_FIFO, SCHED_RR, or SCHED_OTHER.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setschedpolicy.html

◆ pthread_attr_setscope()

int pthread_attr_setscope ( pthread_attr_t attr,
int  contentionscope 
)

Set the contention scope attribute of a thread attributes object.

Parameters
attrThread attributes object.
contentionscopePTHREAD_SCOPE_SYSTEM or PTHREAD_SCOPE_PROCESS.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setscope.html

◆ pthread_getschedparam()

int pthread_getschedparam ( pthread_t  thread,
int *ZRESTRICT  policy,
struct sched_param *ZRESTRICT  param 
)

Get the scheduling policy and parameters of a thread.

Parameters
threadThread to query.
policyOutput: scheduling policy.
paramOutput: scheduling parameters.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getschedparam.html

◆ pthread_setschedparam()

int pthread_setschedparam ( pthread_t  thread,
int  policy,
const struct sched_param *  param 
)

Set the scheduling policy and parameters of a thread.

Parameters
threadThread to modify.
policyNew scheduling policy.
paramNew scheduling parameters.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setschedparam.html

◆ pthread_setschedprio()

int pthread_setschedprio ( pthread_t  thread,
int  prio 
)

Set the scheduling priority of a thread.

Parameters
threadThread to modify.
prioNew priority value.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setschedprio.html