.TH "ost::WriteLock" 3 "Sun Dec 27 2020" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH NAME ost::WriteLock \- The \fBWriteLock\fP class is used to protect a section of code through a \fBThreadLock\fP for 'write' access to the member function\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBWriteLock\fP (\fBThreadLock\fP &_tl)" .br .RI "Wait for write access\&. " .ti -1c .RI "\fB~WriteLock\fP ()" .br .RI "Post the semaphore automatically\&. " .in -1c .SH "Detailed Description" .PP The \fBWriteLock\fP class is used to protect a section of code through a \fBThreadLock\fP for 'write' access to the member function\&. The \fBThreadLock\fP is automatically released when the object falls out of scope\&. .PP A common use is .PP void func_to_protect() { \fBWriteLock\fP lock(threadlock); \&.\&.\&. operation \&.\&.\&. } .PP NOTE: do not declare variable as 'WriteLock (threadlock)', the mutex will be released at statement end\&. .PP \fBAuthor\fP .RS 4 David Sugar dyfet@gnu.org .RE .PP Read mode automatic locker for protected access\&. .SH "Constructor & Destructor Documentation" .PP .SS "ost::WriteLock::WriteLock (\fBThreadLock\fP & _tl)\fC [inline]\fP" .PP Wait for write access\&. .PP \fBParameters\fP .RS 4 \fI_tl\fP reference to threadlock to aquire\&. .RE .PP .PP References ost::ThreadLock::writeLock()\&. .SS "ost::WriteLock::~WriteLock ()\fC [inline]\fP" .PP Post the semaphore automatically\&. .PP References ost::ThreadLock::unlock()\&. .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.