ost::WriteLock(3)
π ost::WriteLock β from the ost C++ library (section 3, Library Functions Manual) π
β¨ NAME β¨
ost::WriteLock β the class that guards a chunk of your code through a ThreadLock, giving you 'write' access to the member function. it's giving bodyguard energy fr π«Ά
π¦ SYNOPSIS π¦
#include <thread.h>
πΈ Public Member Functions πΈ
WriteLock (ThreadLock &_tl)β wait for write access β³~WriteLock ()β post the semaphore automatically, no manual cleanup bestie π
π Detailed Description π
okay so here's the whole vibe: the WriteLock class protects a section of your code through a ThreadLock, and it's doing it for 'write' access to the member function. she's exclusive, she's committed, she's not sharing π
the ThreadLock is automatically released when the object falls out of scope. like, she cleans up after herself without you even asking. iconic behaviour, truly. β¨
a common use is:
void func_to_protect() { WriteLock lock(threadlock); ... operation ... }
π¨ NOTE: do not declare the variable as 'WriteLock (threadlock)' β the mutex will be released at statement end. like, the lock will dip immediately and your protection is GONE. do not do this. i am begging. π
Author David Sugar dyfet@gnu.org π
Read mode automatic locker for protected access.
π§ Constructor & Destructor Documentation π§
π« ost::WriteLock::WriteLock (ThreadLock & _tl) [inline] π«
wait for write access. she's waiting her turn, patiently, like a main character. β
Parameters
_tlβ reference to threadlock to aquire.
References ost::ThreadLock::writeLock().
π« ost::WriteLock::~WriteLock () [inline] π«
post the semaphore automatically. no manual release needed, she handles it on her way out. periodt. π
References ost::ThreadLock::unlock().
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page bestie!! this lil number lives in the GNU CommonC++ collection, and the version/date on the tin says Sun Dec 27 2020 β ost::WriteLock(3), that's a wrap, 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