ost::ThreadLock(3)
π ost::ThreadLock β from the Library Functions Manual, section 3 π
okay bestie, sit down, we're doing a whole class today. this is ost::ThreadLock and she's literally the moment. no cap.
β¨ NAME β¨
ost::ThreadLock β the ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not.
(yes, 'impliments'. that's the original spelling and I am NOT touching it, it's part of the lore π«Ά)
πΈ SYNOPSIS πΈ
#include <thread.h>
π Public Member Functions
ThreadLock ()β Create a process shared thread lock object.virtual ~ThreadLock ()β Destroy a process shared thread lock object.void readLock (void)β Aquire a read lock for the current object.void writeLock (void)β Aquire a write lock for the current object.bool tryReadLock (void)β Attempt read lock for current object.bool tryWriteLock (void)β Attempt write lock for current object.void unlock (void)β Release any held locks.
π Detailed Description π
The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not.
so like. if your system has rwlock support, readers get the VIP treatment, everyone can read at once, it's giving main character energy. and if your system doesn't have rwlock support? she doesn't panic, she just quietly falls back to a plain old mutex. adaptable queen π
Author
- David Sugar
dyfet@ostel.com
Posix rwlock extension for protected access.
π¦ Constructor & Destructor Documentation π¦
ost::ThreadLock::ThreadLock ()
Create a process shared thread lock object.
virtual ost::ThreadLock::~ThreadLock () [virtual]
Destroy a process shared thread lock object.
π Member Function Documentation π
void ost::ThreadLock::readLock (void)
Aquire a read lock for the current object.
Referenced by ost::ReadLock::ReadLock().
bool ost::ThreadLock::tryReadLock (void)
Attempt read lock for current object.
Returns
trueon success.
bool ost::ThreadLock::tryWriteLock (void)
Attempt write lock for current object.
Returns
trueon success.
void ost::ThreadLock::unlock (void)
Release any held locks.
Referenced byost::ReadLock::~ReadLock(), andost::WriteLock::~WriteLock().
void ost::ThreadLock::writeLock (void)
Aquire a write lock for the current object.
Referenced by ost::WriteLock::WriteLock().
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page, bestie π
this one came to you from GNU CommonC++, generated automatically by Doxygen from the source code, dated Sun Dec 27 2020 β so it's vintage, it's iconic, it's ost::ThreadLock(3). go lock something safely, mwah πβ¨π¦
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms