Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 730

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Read\-Lock Class Reference}
\label{classost_1_1_read_lock}\index{ost::ReadLock@{ost::ReadLock}}
The {\bf Read\-Lock}{\rm (p.\,\pageref{classost_1_1_read_lock})} class is used to protect a section of code through a {\bf Thread\-Lock}{\rm (p.\,\pageref{classost_1_1_thread_lock})} for \char`\"{}read\char`\"{} access to the member function.Read mode automatic locker for protected access.  


{\tt \#include $<$thread.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Read\-Lock} ({\bf Thread\-Lock} \&\_\-tl)
\begin{CompactList}\small\item\em Wait for read access. \item\end{CompactList}\item 
{\bf $\sim$Read\-Lock} ()
\begin{CompactList}\small\item\em Post the semaphore automatically. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
The {\bf Read\-Lock}{\rm (p.\,\pageref{classost_1_1_read_lock})} class is used to protect a section of code through a {\bf Thread\-Lock}{\rm (p.\,\pageref{classost_1_1_thread_lock})} for \char`\"{}read\char`\"{} access to the member function.Read mode automatic locker for protected access. 

The {\bf Thread\-Lock}{\rm (p.\,\pageref{classost_1_1_thread_lock})} is automatically released when the object falls out of scope.

A common use is

void func\_\-to\_\-protect() \{ {\bf Read\-Lock}{\rm (p.\,\pageref{classost_1_1_read_lock})} lock(threadlock); ... operation ... \}

NOTE: do not declare variable as \char`\"{}Read\-Lock (threadlock)\char`\"{}, the mutex will be released at statement end.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@gnu.org}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::ReadLock@{ost::Read\-Lock}!ReadLock@{ReadLock}}
\index{ReadLock@{ReadLock}!ost::ReadLock@{ost::Read\-Lock}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Read\-Lock::Read\-Lock ({\bf Thread\-Lock} \& {\em \_\-tl})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_read_lock_05b7c96baf6695c580871d0aaf01c149}


Wait for read access. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-tl}]reference to lock to aquire. \end{description}
\end{Desc}
\index{ost::ReadLock@{ost::Read\-Lock}!~ReadLock@{$\sim$ReadLock}}
\index{~ReadLock@{$\sim$ReadLock}!ost::ReadLock@{ost::Read\-Lock}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Read\-Lock::$\sim$Read\-Lock ()\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_read_lock_166b6a55b9fa7072be782b7eccf30a98}


Post the semaphore automatically. 



The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf thread.h}\end{CompactItemize}