\hypertarget{class_s_c_i_run_1_1_guard}{\section{Guard Class Reference}
\label{class_s_c_i_run_1_1_guard}\index{Guard@{Guard}}
}


{\ttfamily \#include $<$Guard.\-h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2}{Which} \{ \hyperlink{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2a809abe96853e69894bbf8e5730b31348}{Read}, 
\hyperlink{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2aa56670174817e3fed92bfd8182d7c0d1}{Write}
 \}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_s_c_i_run_1_1_guard_af9847226e2342134d6c8fc804fb35b2b}{Guard} (\hyperlink{class_s_c_i_run_1_1_mutex}{Mutex} $\ast$mutex)
\item 
\hyperlink{class_s_c_i_run_1_1_guard_ab30b006692c5a6a797c180c352be7cd5}{Guard} (\hyperlink{class_s_c_i_run_1_1_recursive_mutex}{Recursive\-Mutex} $\ast$rmutex)
\item 
\hyperlink{class_s_c_i_run_1_1_guard_a777899d1da08fdc6cfeaee5be05842ef}{Guard} (\hyperlink{class_s_c_i_run_1_1_crowd_monitor}{Crowd\-Monitor} $\ast$crowd\-Monitor, \hyperlink{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2}{Which} action)
\item 
\hyperlink{class_s_c_i_run_1_1_guard_a53272556282cd8793ebe597633310335}{$\sim$\-Guard} ()
\begin{DoxyCompactList}\small\item\em Release the lock acquired by the constructor. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Member Enumeration Documentation}
\hypertarget{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2}{\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Which@{Which}}
\index{Which@{Which}!SCIRun::Guard@{S\-C\-I\-Run\-::\-Guard}}
\subsubsection[{Which}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Which}}}\label{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{Read@{Read}!S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}}\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Read@{Read}}\item[{\em 
\hypertarget{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2a809abe96853e69894bbf8e5730b31348}{Read}\label{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2a809abe96853e69894bbf8e5730b31348}
}]\index{Write@{Write}!S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}}\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Write@{Write}}\item[{\em 
\hypertarget{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2aa56670174817e3fed92bfd8182d7c0d1}{Write}\label{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2aa56670174817e3fed92bfd8182d7c0d1}
}]\end{description}
\end{Desc}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_s_c_i_run_1_1_guard_af9847226e2342134d6c8fc804fb35b2b}{\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Guard@{Guard}}
\index{Guard@{Guard}!SCIRun::Guard@{S\-C\-I\-Run\-::\-Guard}}
\subsubsection[{Guard}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Guard} (
\begin{DoxyParamCaption}
\item[{{\bf Mutex} $\ast$}]{mutex}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_guard_af9847226e2342134d6c8fc804fb35b2b}
Attach the {\bfseries \hyperlink{class_s_c_i_run_1_1_guard}{Guard}} object to the {\itshape mutex}, and acquire the mutex. \hypertarget{class_s_c_i_run_1_1_guard_ab30b006692c5a6a797c180c352be7cd5}{\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Guard@{Guard}}
\index{Guard@{Guard}!SCIRun::Guard@{S\-C\-I\-Run\-::\-Guard}}
\subsubsection[{Guard}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Guard} (
\begin{DoxyParamCaption}
\item[{{\bf Recursive\-Mutex} $\ast$}]{rmutex}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_guard_ab30b006692c5a6a797c180c352be7cd5}
\hypertarget{class_s_c_i_run_1_1_guard_a777899d1da08fdc6cfeaee5be05842ef}{\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!Guard@{Guard}}
\index{Guard@{Guard}!SCIRun::Guard@{S\-C\-I\-Run\-::\-Guard}}
\subsubsection[{Guard}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Guard} (
\begin{DoxyParamCaption}
\item[{{\bf Crowd\-Monitor} $\ast$}]{crowd\-Monitor, }
\item[{{\bf Which}}]{action}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_guard_a777899d1da08fdc6cfeaee5be05842ef}
Attach the {\bfseries \hyperlink{class_s_c_i_run_1_1_guard}{Guard}} to the {\itshape \hyperlink{class_s_c_i_run_1_1_crowd_monitor}{Crowd\-Monitor} and acquire one of the locks. If {\itshape action} is {\bfseries \hyperlink{class_s_c_i_run_1_1_guard_a76832237d5d837232469a6c46f1eeff2a809abe96853e69894bbf8e5730b31348}{Guard\-::\-Read}}, the read lock will be acquired, and if {\itshape action} is {\bfseries Write}, then the write lock will be acquired. The appropriate lock will then be released by the destructor }\hypertarget{class_s_c_i_run_1_1_guard_a53272556282cd8793ebe597633310335}{\index{S\-C\-I\-Run\-::\-Guard@{S\-C\-I\-Run\-::\-Guard}!$\sim$\-Guard@{$\sim$\-Guard}}
\index{$\sim$\-Guard@{$\sim$\-Guard}!SCIRun::Guard@{S\-C\-I\-Run\-::\-Guard}}
\subsubsection[{$\sim$\-Guard}]{\setlength{\rightskip}{0pt plus 5cm}$\sim${\bf Guard} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_guard_a53272556282cd8793ebe597633310335}


Release the lock acquired by the constructor. 



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Core/\-Thread/\-Legacy/\hyperlink{_guard_8h}{Guard.\-h}\end{DoxyCompactItemize}
