PTHREAD_R...R_DESTROY(3P)
β¨ PTHREAD_RWLOCKATTR_DESTROY, PTHREAD_RWLOCKATTR_INIT β¨
okay bestie, we're doing the POSIX Programmer's Manual today π
this is the PTHREAD_R...R_DESTROY(3P) page, yes the title got truncated like that, it's fine, it's giving mystery, it's giving ellipsis-core π
πΈ PROLOG πΈ
so real talk first: this manual page is part of the POSIX Programmer's Manual. but heads up β the Linux implementation of this interface may differ (in which case you go consult the corresponding Linux manual page for the deets on Linux behavior), or like... the interface might not even be implemented on Linux at all π no cap.
π NAME π
pthread_rwlockattr_destroy, pthread_rwlockattr_init β destroy and initialize the read-write lock attributes object π
π¦ SYNOPSIS π¦
#include <pthread.h>
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
π DESCRIPTION π
pthread_rwlockattr_destroy() shall destroy a read-write lock attributes object. and the way that a destroyed attr object can be reinitialized using pthread_rwlockattr_init()? iconic. but the results of otherwise referencing that object after it's been destroyed are undefined π so don't be messy. also, an implementation may cause pthread_rwlockattr_destroy() to set the object referenced by attr to an invalid value. noted.
pthread_rwlockattr_init() shall initialize a read-write lock attributes object attr with the default value for all of the attributes defined by the implementation. fresh start, clean slate, main character energy β¨
Results are undefined ifpthread_rwlockattr_init()is called specifying an already initializedattrattributes object. do not double-init, that's not slay, that's chaos π
after a read-write lock attributes object has been used to initialize one or more read-write locks, any function affecting the attributes object (including destruction, yes even that) shall not affect any previously initialized read-write locks. so like, the locks you already made are safe, they're independent, they don't care what you do to the attrs afterwards π«Ά
The behavior is undefined if the value specified by theattrargument topthread_rwlockattr_destroy()does not refer to an initialized read-write lock attributes object. fr fr, check your pointers.
β RETURN VALUE β
if it's a success, both pthread_rwlockattr_destroy() and pthread_rwlockattr_init() shall return zero π otherwise, an error number shall be returned to indicate the error.
π ERRORS π
pthread_rwlockattr_init() shall fail if:
ENOMEMβ insufficient memory exists to initialize the read-write lock attributes object. (the audacity of your RAM honestly π€)
these functions shall not return an error code of [EINTR].
the following sections are informative β like, they're the bonus tracks, not the main album πΈ
π EXAMPLES π
None.
π§ APPLICATION USAGE π§
None.
π RATIONALE π
so if an implementation detects that the value specified by the attr argument to pthread_rwlockattr_destroy() does not refer to an initialized read-write lock attributes object, it is recommended that the function should fail and report an [EINVAL] error. that's the recommendation, bestie, not the law β it's giving "please be nice to the users" π
π₯ FUTURE DIRECTIONS π₯
None.
πΈ SEE ALSO πΈ
pthread_rwlock_destroy()pthread_rwlockattr_getpshared()
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 .
okay that's the whole page, you ate it, you're basically a pthreads girlie now π
signing off with love from IEEE/The Open Group, the year 2017, and the manual entry PTHREAD_R...R_DESTROY(3P) πβ¨π¦
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms