docs::a...dRWLock(3)

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

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/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 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. πŸ‘‘

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