PTHREAD_RWLOCKATTR_DESTROY(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1, nixpkgs unstable

πŸ’… PTHREAD_RWLOCKATTR_DESTROY(3) πŸ’…

okay so bestie, you're in section 3 of the manual β€” that's the library functions section, iykyk β€” and today's main character is pthread_rwlockattr_destroy. yes, it's a long name, no, we're not abbreviating it, we're respecting her πŸ’–


✨ NAME ✨

pthread_rwlockattr_destroy β€” destroy a read/write lock attributes object πŸŽ€

like, literally just clean up after yourself, that's the whole vibe.


πŸ“š LIBRARY πŸ“š

POSIX Threads Library (that's libpthread, and you link it with -lpthread) 🧡✨


🫢 SYNOPSIS 🫢

#include <pthread.h>

int
pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);

she takes exactly one argument, returns an int, that's it, that's the whole function signature, periodt 🌸


πŸ’« DESCRIPTION πŸ’«

so pthread_rwlockattr_destroy() is the function you call to destroy a read/write lock attributes object β€” specifically one that was previously created with pthread_rwlockattr_init(). πŸ¦‹

think of it as the goodbye hug after the hello hug. init makes it, destroy un-makes it. the way that closure is important πŸ˜­πŸ’œ


πŸ”₯ RETURN VALUES πŸ”₯

if everything goes great (and we love that for you), pthread_rwlockattr_destroy() returns zero. πŸŽ‰

otherwise it returns an error number to tell you what went wrong β€” that's error number, not -1 with errno set, so don't come for her with the errno assumptions πŸ™ˆ


πŸ’€ ERRORS πŸ’€

the pthread_rwlockattr_destroy() function may fail if:

  • [EINVAL] β€” the value specified by attr is invalid. 🚩 like, she looked at what you passed her and went "bestie what is this". make sure attr is actually a real attributes object, okay?
note: it says may fail, so this is the possible failure mode, not a promise. ngl, the wording is doing a lot of heavy lifting here 🫠

πŸŽ€ SEE ALSO πŸŽ€


🌈 STANDARDS 🌈

pthread_rwlockattr_destroy() is expected to conform to Version 2 of the Single UNIX Specification β€” you'll see that written as β€œSUSv2” πŸ‘‘βœ¨ so yes she's certified, she's legit, she's on spec.


🧚 HISTORY 🧚

pthread_rwlockattr_destroy() first appeared in FreeBSD 3.0. ⭐ a whole era. a whole legacy. we stan a longstanding API.


and that's the page, bestie 🫢 go destroy those attributes responsibly, and remember: what init joins together, destroy puts asunder πŸ’…

Debian 🌸 August 4, 1998 β€” yeah she's been sitting in this manpage since the late nineties and she still ate, fr fr πŸ’–πŸŽ€

πŸ“¦ where this page comes from