docs::a...eadMutex(3)
π NAME π
okay so this page is docs::a...eadMutex(3), from the User Contributed Perl Documentation crew, and it's literally all about APR::ThreadMutex β the Perl API for APR thread mutexes. no cap. π
β¨ Synopsis β¨
the whole vibe check, bestie:
use APR::ThreadMutex ();
my $mutex = APR::ThreadMutex->new($r->pool);
$mutex->lock;
$mutex->unlock;
$mutex->trylock;
π¦ Description π¦
APR::ThreadMutex interfaces APR thread mutexes. that's the description, fr fr. π¦
π₯ API π₯
APR::ThreadMutex provides the following functions and/or methods β main character energy only:
π Unsupported API π
okay so APR::ThreadMutex also provides an auto-generated Perl interface for a few other methods which aren't tested at the moment, so 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 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. π«Ά
heads up: this is the βnot officially supported yetβ zone, iykyk.
π DESTROY π
META: Autogenerated - needs to be reviewed/completed
destroy the mutex and free the memory associated with the lock. not me cleaning up memory. π
$mutex->DESTROY();
- obj:
$mutex("APR::ThreadMutex object") β the mutex to destroy. - ret: no return value
- since: subject to change
π lock π
META: Autogenerated - needs to be reviewed/completed
acquire the lock for the given mutex. if the mutex is already locked, the current thread will be put to sleep until the lock becomes available π΄. the way that sounds so dramatic but it's literally the spec.
$ret = $mutex->lock();
- obj:
$mutex("APR::ThreadMutex object") β the mutex on which to acquire the lock. - ret:
$ret( integer ) - since: subject to change
β¨ new β¨
create a new mutex. fresh mutex, new me, periodt. π
my $mutex = APR::ThreadMutex->new($p);
- obj:
APR::ThreadMutex( class name ) - arg1:
$p("APR::Pool object") - ret:
$mutex("APR::ThreadMutex 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_mutex. obsessed with pool access, ngl. π
$ret = $obj->pool_get();
- obj:
$obj("APR::ThreadMutex object") - ret:
$ret("APR::Pool object") βapr_pool_tthe pool - since: subject to change
π― trylock π―
META: Autogenerated - needs to be reviewed/completed
attempt to acquire the lock for the given mutex. if the mutex has already been acquired, the call returns immediately with APR_EBUSY. π¨
important: it is important that theAPR_STATUS_IS_EBUSY(s)macro be used to determine if the return value wasAPR_EBUSY, for portability reasons. highkey do not skip this.
$ret = $mutex->trylock();
- obj:
$mutex("APR::ThreadMutex object") β the mutex on which to attempt the lock acquiring. - ret:
$ret(integer) - since: subject to change
π unlock π
META: Autogenerated - needs to be reviewed/completed
release the lock for the given mutex. bye lock, ate. π
$ret = $mutex->unlock();
- obj:
$mutex("APR::ThreadMutex object") β the mutex from which to release the lock. - ret:
$ret( integer ) - since: subject to change
π See Also π
mod_perl 2.0 documentation. go read it, bestie. π
π Copyright π
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. periodt. π
π«Ά Authors π«Ά
The mod_perl development team and numerous contributors. iconic. π
okay that's the whole page, bestie. this one ships with perl v5.42.3, dated 2023-10-21, and it's docs::a...eadMutex(3). slay. π
β¨
π¦ 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