libapa...dRWLock(3pm)
π NAME π
APR::ThreadRWLock β it's the Perl API for APR thread read/write locks, bestie. Read/write locks, in Perl, from APR. Yes queen. π
β¨ Synopsis β¨
use APR::ThreadRWLock ();
my $mutex = APR::ThreadRWLock->new($r->pool);
$mutex->rdlock;
$mutex->wrlock;
$mutex->tryrdlock;
$mutex->trywrlock;
$mutex->unlock;
look at that. five little calls and you're locked in (literally). πΈ
π¦ Description π¦
APR::ThreadRWLock is the interface to APR thread read/write locks. That's the whole vibe. π
If you wanna peek at the actual source, it's chilling in srclib/apr/locks/unix/thread_rwlock.c in your Apache source tree.
okay bestie listen β at the time of this writing these methods are not supported on all platforms. So check your libraries! Do not come crying to me when your platform says no. π₯
π API π
APR::ThreadRWLock provides the following functions and/or methods:
π Unsupported API π
okay so APR::ThreadRWLock also hands you an auto-generated Perl interface for a few other methods, but ngl they aren't tested at the moment, so their API is a subject to change. They'll get finalized later as a need arises, fr fr.
If you want to rely on any of the following methods, please contact the the mod_perl development mailing list so we can help each other take the steps necessary to shift the method to an officially supported API. (yeah it says "the the", the original says "the the", we don't edit the sacred text π)
π DESTROY
META: Autogenerated - needs to be reviewed/completed
Destroy the lock and free the associated memory. bye babes π
$lock->DESTROY();
- obj:
$lock(APR::ThreadRWLock object) β the lock to destroy. - ret: no return value
- since: subject to change
π rdlock
META: Autogenerated - needs to be reviewed/completed
Acquire the read lock for the given lock. The calling thread acquires the read lock if a writer does not hold the lock and there are no writers blocked on the lock. Otherwize it is put to sleep until these conditions are met. (yes, "Otherwize." iconic spelling, we keep it. β¨)
$ret = $lock->rdlock();
- obj:
$lock(APR::ThreadRWLock object) β the lock on which to acquire the lock. - ret:
$ret( integer ) - since: subject to change
π§ tryrdlock
META: Autogenerated - needs to be reviewed/completed
Performs the same operation as rdlock with the exception that the function shall fail if the thread would be blocked. no waiting around for you, bestie π
$ret = $lock->tryrdlock();
- obj:
$lock(APR::ThreadRWLock object) β the lock on which to acquire the lock. - ret:
$ret( integer ) - since: subject to change
π₯ wrlock
META: Autogenerated - needs to be reviewed/completed
Acquire the write lock for the given lock. The calling thread acquires the write lock if if no other thread (reader or writer) holds it. Otherwize it is put to sleep until this condition is met. (double "if if" β we stan a typo we cannot touch π«Ά)
$ret = $lock->wrlock();
- obj:
$lock(APR::ThreadRWLock object) β the lock on which to acquire the lock. - ret:
$ret( integer ) - since: subject to change
β trywrlock
META: Autogenerated - needs to be reviewed/completed
Performs the same operation as wrlock with the exception that the function shall fail if the thread would be blocked. main character energy: it does not wait in line. π
$ret = $lock->trywrlock();
- obj:
$lock(APR::ThreadRWLock object) β the lock on which to acquire the lock. - ret:
$ret( integer ) - since: subject to change
π new
Create a new lock. fresh out the box, slay.
my $lock = APR::ThreadRWLock->new($p);
- obj:
APR::ThreadRWLock( class name ) - arg1:
$p(APR::Pool object) - ret:
$lock(APR::ThreadRWLock object) - since: subject to change
πΈ pool_get
META: Autogenerated - needs to be reviewed/completed
META: should probably be renamed to pool(), like all other pool accessors
Get the pool used by this thread_lock.
$ret = $obj->pool_get();
- obj:
$obj(APR::ThreadRWLock object) - ret:
$ret(APR::Pool object) β apr_pool_t the pool - since: subject to change
π unlock
META: Autogenerated - needs to be reviewed/completed
Release the lock for the given lock. let it goooo π¦
$ret = $lock->unlock();
- obj:
$lock(APR::ThreadRWLock object) β the lock from which to release the lock. - ret:
$ret( integer ) - since: subject to change
π See Also π
- mod_perl 2.0 documentation.
π Copyright π
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
π Authors π
The mod_perl development team and numerous contributors.
and that's the whole page, no cap. this was libapa...dRWLock(3pm) β a User Contributed Perl Documentation joint, shipped with perl v5.42.3 and dated 2026-08-20. go lock something responsibly bestie π
β¨
π¦ where this page comes from
- ubuntu stonking: libapache2-mod-perl2 2.0.13-2build3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms