docs::a...dRWLock(3)
NAME π
docs::a...dRWLock(3) β APR::ThreadRWLock - Perl API for APR thread read/write locks. That's the name section, bestie. π
β¨ Synopsis β¨
Okay so here's the little intro snippet, no cap:
use APR::ThreadRWLock ();
my $mutex = APR::ThreadRWLock->new($r->pool);
$mutex->rdlock;
$mutex->wrlock;
$mutex->tryrdlock;
$mutex->trywrlock;
$mutex->unlock;
π¦ Description π¦
APR::ThreadRWLock interfaces APR thread read/write locks.
Lowkey important: see srclib/apr/locks/unix/thread_rwlock.c in your Apache source tree. At the time of this writing these methods are not supported on all platforms. Thus, check your libraries! π
π API π
APR::ThreadRWLock provides the following functions and/or methods:
π Unsupported API π
Okay so there's more: APR::ThreadRWLock also provides an auto-generated Perl interface for a few other methods which aren't tested at the moment and therefore their API is a subject to change. These methods will be finalized later as a need arises. If you want to rely on any of the following methods please contact 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. iykyk π«Ά
DESTROY π
META: Autogenerated - needs to be reviewed/completed
Destroy the lock and free the associated memory.
$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. Otherwise it is put to sleep until these conditions are met. π΄
$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. Yes, bestie, it's giving "try before you sleep." β¨
$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 no other thread (reader or writer) holds it. Otherwise it is put to sleep until this condition is met. π΄
$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. Same energy as tryrdlock, just write-lock flavored. π¦
$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 π
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/completedMETA: 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_tthe pool - since: subject to change
unlock π
META: Autogenerated - needs to be reviewed/completed
Release the lock for the given lock. Let it go, let it gooo. π«Ά
$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 π
Go check out the 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. π«Ά
π That's the whole page, bestie! Source vibe: User Contributed Perl Documentation; version perl v5.42.3; date 2023-10-21. Bye! π
π¦ where this page comes from
- nixos 26.05: mod_perl 2.0.13
- nixpkgs unstable: mod_perl 2.0.13
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms