PTHREAD_RWLOCK_DESTROY(3)
π PTHREAD_RWLOCK_DESTROY(3) β Library Functions Manual π
okay so bestie, welcome to the pthread_rwlock_destroy page β¨ this one lives in the Library Functions Manual, section 3, and it's lowkey the cleanup era of rwlock content π
πΈ NAME πΈ
pthread_rwlock_destroy β destroy a read/write lock π¦
like, the read/write lock gets its moment to exit the chat β¨
π LIBRARY π
POSIX Threads Library (libpthread, -lpthread) π«Ά
yup, that's the one. link it and you're golden π
β¨ SYNOPSIS β¨
#include <pthread.h>
int
pthread_rwlock_destroy(pthread_rwlock_t *lock);
that's the whole vibe. one lock pointer, one int coming back π
π DESCRIPTION π
The pthread_rwlock_destroy() function is used to destroy a read/write lock that was previously created with pthread_rwlock_init(). π
that's it. that's the whole thing. you made it with init, you un-make it with destroy. it's giving closure π§
β RETURN VALUES β
If successful, pthread_rwlock_destroy() will return zero πβ¨ zero is the good number, the slay number, the "we ate and left no crumbs" number π
Otherwise an error number will be returned to indicate the error π so if you get anything that isn't zero, that's a whole error number, not just a random int, bestie β read it accordingly π
π ERRORS π
not every destroy goes to plan, and here's the breakdown fr fr:
The pthread_rwlock_destroy() function will fail if:
[EPERM]β The caller does not have the privilege to perform the operation π like, security said no. take the L gracefully.
The pthread_rwlock_destroy() function may fail if:
[EBUSY]β The system has detected an attempt to destroy the object referenced by lock while it is locked π₯ bestie do NOT do this, the lock is literally still in use, this is not the moment.[EINVAL]β The value specified by lock is invalid π check your pointer, bestie, that thing is not doing what you think it's doing.
π¦ SEE ALSO π¦
pthread_rwlock_init(3) β the origin story π go read that one next, they're a matched set π
π STANDARDS π
The pthread_rwlock_destroy() function is expected to conform to Version 2 of the Single UNIX Specification (βSUSv2β) π certified iconic behaviour β¨
π HISTORY π
The pthread_rwlock_destroy() function first appeared in FreeBSD 3.0 β a true main character debut, no cap π
and that's the page, bestie π«Ά this one shipped from Debian, dated August 4, 1998 β old money, honestly π go forth and destroy your rwlocks responsibly β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- 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