PTHREAD...CEILING(3POSIX)
โจ PTHREAD...CEILING โจ
okay bestie, welcome to the POSIX Programmer's Manual ๐ โ this page is literally called PTHREAD...CEILING(3POSIX) and it's giving realtime-threads realness, no cap.
๐ธ PROLOG ๐ธ
This manual page is part of the POSIX Programmer's Manual. Heads up though, bestie: the Linux implementation of this interface may differ (so go consult the corresponding Linux manual page for the deets on Linux behavior), or the interface might not even be implemented on Linux at all. ๐ญ
๐ NAME ๐
pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling โ get and set the prioceiling attribute of the mutex attributes object (REALTIME THREADS ๐ฅ)
โจ SYNOPSIS โจ
#include <pthread.h>
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t
*restrict attr, int *restrict prioceiling);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
int prioceiling);
๐ฆ DESCRIPTION ๐ฆ
So like, pthread_mutexattr_getprioceiling() and pthread_mutexattr_setprioceiling() do the whole get-and-set thing respectively โ they get and set the priority ceiling attribute of a mutex attributes object pointed to by attr, which was previously created by the function pthread_mutexattr_init(). Periodt. ๐
The prioceiling attribute contains the priority ceiling of initialized mutexes. The values of prioceiling live within the maximum range of priorities defined by SCHED_FIFO. ๐
Okay so here's the tea: the prioceiling attribute defines the priority ceiling of initialized mutexes, which is the minimum priority level at which the critical section guarded by the mutex is executed. And in order to avoid priority inversion (๐ not that), the priority ceiling of the mutex shall be set to a priority higher than or equal to the highest priority of all the threads that may lock that mutex. And yes, the values of prioceiling are within the maximum range of priorities defined under the SCHED_FIFO scheduling policy. Slay.
โ ๏ธ The behavior is undefined if the value specified by the attr argument topthread_mutexattr_getprioceiling()orpthread_mutexattr_setprioceiling()does not refer to an initialized mutex attributes object. Like, don't do that. Fr fr. ๐
๐ RETURN VALUE ๐
Upon successful completion, pthread_mutexattr_getprioceiling() and pthread_mutexattr_setprioceiling() shall return zero ๐ โ otherwise, an error number shall be returned to indicate the error.
๐ ERRORS ๐
These functions may fail if:
EINVALโ The value specified byprioceilingis invalid.EPERMโ The caller does not have the privilege to perform the operation. (no permission, no party ๐ซ)
These functions shall not return an error code of [EINTR]. Not ever. ๐
The following sections are informative. ๐
๐ EXAMPLES ๐
None.
๐ง APPLICATION USAGE ๐ง
None.
โญ RATIONALE โญ
If an implementation detects that the value specified by the attr argument to pthread_mutexattr_getprioceiling() or pthread_mutexattr_setprioceiling() does not refer to an initialized mutex attributes object, it is recommended that the function should fail and report an [EINVAL] error. Like, just fail loudly, that's the vibe. ๐ฃ
๐ฎ FUTURE DIRECTIONS ๐ฎ
None.
๐ SEE ALSO ๐
pthread_cond_destroy()pthread_create()pthread_mutex_destroy()
The Base Definitions volume of POSIX.1โ2017, <pthread.h> ๐
๐ COPYRIGHT ๐
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
k that's the whole page bestie, mwah ๐ โ brought to you by IEEE/The Open Group, dated 2017, filed under PTHREAD...CEILING(3POSIX). ate and left no crumbs โจ
๐ฆ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 ยท Other
- debian trixie: manpages-posix-dev 2017a-2 ยท Other
- ubuntu jammy: manpages-posix-dev 2017a-2 ยท Other
- ubuntu noble: manpages-posix-dev 2017a-2 ยท Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 ยท Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 ยท Other
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms