PTHREAD_RWLOCKATTR_DESTROY(3)
π 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 byattris invalid. π© like, she looked at what you passed her and went "bestie what is this". make sureattris 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 π
pthread_rwlockattr_init(3)β the other half of this story, the origin story if you will π
π 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: whatinitjoins together,destroyputs 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
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Alex Nash
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms