docs::a...eadMutex(3)

πŸ“¦ version 2.0.13, in nixos 26.05, nixpkgs unstable

πŸ’… 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_t the 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 the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return value was APR_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. πŸ“š

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