Sophie

Sophie

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

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

\section{ost::Mutex\-Counter Class Reference}
\label{classost_1_1_mutex_counter}\index{ost::MutexCounter@{ost::MutexCounter}}
The {\bf Mutex}{\rm (p.\,\pageref{classost_1_1_mutex})} {\bf Counter}{\rm (p.\,\pageref{classost_1_1_counter})} is a counter variable which can safely be incremented or decremented by multiple {\bf threads.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} protected integer counter.  


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

Inheritance diagram for ost::Mutex\-Counter::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classost_1_1_mutex_counter}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Mutex\-Counter} (const char $\ast$id=NULL)
\begin{CompactList}\small\item\em Create and optionally name a mutex protected counter. \item\end{CompactList}\item 
{\bf Mutex\-Counter} (int initial, const char $\ast$id=NULL)
\begin{CompactList}\small\item\em Create and optionally name a mutex protected counter with an initial value. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
\_\-\_\-EXPORT int {\bf operator++} ({\bf Mutex\-Counter} \&mc)
\item 
\_\-\_\-EXPORT int {\bf operator--} ({\bf Mutex\-Counter} \&mc)
\end{CompactItemize}


\subsection{Detailed Description}
The {\bf Mutex}{\rm (p.\,\pageref{classost_1_1_mutex})} {\bf Counter}{\rm (p.\,\pageref{classost_1_1_counter})} is a counter variable which can safely be incremented or decremented by multiple {\bf threads.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} protected integer counter. 

A {\bf Mutex}{\rm (p.\,\pageref{classost_1_1_mutex})} is used to protect access to the counter variable (an integer). An initial value can be specified for the counter, and it can be manipulated with the ++ and -- operators.

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




\subsection{Constructor \& Destructor Documentation}
\index{ost::MutexCounter@{ost::Mutex\-Counter}!MutexCounter@{MutexCounter}}
\index{MutexCounter@{MutexCounter}!ost::MutexCounter@{ost::Mutex\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Mutex\-Counter::Mutex\-Counter (const char $\ast$ {\em id} = {\tt NULL})}\label{classost_1_1_mutex_counter_bdb64adac3f0fd69aa92ccd6e024d738}


Create and optionally name a mutex protected counter. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em id}]name for mutex counter, optional for deadlock testing. \end{description}
\end{Desc}
\index{ost::MutexCounter@{ost::Mutex\-Counter}!MutexCounter@{MutexCounter}}
\index{MutexCounter@{MutexCounter}!ost::MutexCounter@{ost::Mutex\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Mutex\-Counter::Mutex\-Counter (int {\em initial}, const char $\ast$ {\em id} = {\tt NULL})}\label{classost_1_1_mutex_counter_9387a4385d82748ae177b911f7e45cdb}


Create and optionally name a mutex protected counter with an initial value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em initial}]value of counter. \item[{\em id}]name of counter, optional for deadlock testing. \end{description}
\end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::MutexCounter@{ost::Mutex\-Counter}!operator++@{operator++}}
\index{operator++@{operator++}!ost::MutexCounter@{ost::Mutex\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\_\-\_\-EXPORT int operator++ ({\bf Mutex\-Counter} \& {\em mc})\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_mutex_counter_492dd40022f552e2a876a2024a911311}


\index{ost::MutexCounter@{ost::Mutex\-Counter}!operator--@{operator--}}
\index{operator--@{operator--}!ost::MutexCounter@{ost::Mutex\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\_\-\_\-EXPORT int operator-- ({\bf Mutex\-Counter} \& {\em mc})\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_mutex_counter_05e6a8049e92770f04bdd47d435931cc}




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