Sophie

Sophie

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

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

\section{ost::Lockfile Class Reference}
\label{classost_1_1_lockfile}\index{ost::Lockfile@{ost::Lockfile}}
This class is used to create a \char`\"{}named\char`\"{} lock entity that can be used to control access to a resource between multiple processes.System-wide named lock.  


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

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Lockfile} (const char $\ast$name)
\begin{CompactList}\small\item\em Create a lock under a known name. \item\end{CompactList}\item 
{\bf Lockfile} ()
\begin{CompactList}\small\item\em Create a new lock object that can be used to make locks. \item\end{CompactList}\item 
{\bf $\sim$Lockfile} ()
\begin{CompactList}\small\item\em Destroy the current lock and release it. \item\end{CompactList}\item 
bool {\bf lock} (const char $\ast$name)
\begin{CompactList}\small\item\em Lock a system-wide name for this process. \item\end{CompactList}\item 
void {\bf unlock} (void)
\begin{CompactList}\small\item\em Release an acquired lock. \item\end{CompactList}\item 
bool {\bf is\-Locked} (void)
\begin{CompactList}\small\item\em Flag if the current process has aqcuired a lock. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class is used to create a \char`\"{}named\char`\"{} lock entity that can be used to control access to a resource between multiple processes.System-wide named lock. 

The posix implimentation uses a pidfile and the win32 version uses a globally visible mutex.

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




\subsection{Constructor \& Destructor Documentation}
\index{ost::Lockfile@{ost::Lockfile}!Lockfile@{Lockfile}}
\index{Lockfile@{Lockfile}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Lockfile::Lockfile (const char $\ast$ {\em name})}\label{classost_1_1_lockfile_650710f23bf875e3ea52ae95b2239d74}


Create a lock under a known name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]of system-wide lock to create. \end{description}
\end{Desc}
\index{ost::Lockfile@{ost::Lockfile}!Lockfile@{Lockfile}}
\index{Lockfile@{Lockfile}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Lockfile::Lockfile ()}\label{classost_1_1_lockfile_8b743f029d010f77ce1d438c603005e7}


Create a new lock object that can be used to make locks. 

\index{ost::Lockfile@{ost::Lockfile}!~Lockfile@{$\sim$Lockfile}}
\index{~Lockfile@{$\sim$Lockfile}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Lockfile::$\sim$Lockfile ()\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_lockfile_e3cd7ce383a40bfe81cdf827cc1131e3}


Destroy the current lock and release it. 



\subsection{Member Function Documentation}
\index{ost::Lockfile@{ost::Lockfile}!isLocked@{isLocked}}
\index{isLocked@{isLocked}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Lockfile::is\-Locked (void)}\label{classost_1_1_lockfile_4172440e8c67b7c2b3e6646c3186d4c2}


Flag if the current process has aqcuired a lock. 

\begin{Desc}
\item[Returns:]true if we have the lock. \end{Desc}
\index{ost::Lockfile@{ost::Lockfile}!lock@{lock}}
\index{lock@{lock}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Lockfile::lock (const char $\ast$ {\em name})}\label{classost_1_1_lockfile_1564016ea1fc36677921739d0307f937}


Lock a system-wide name for this process. 

If the lock is successful, return true. If an existing lock was already acquired, release it first.

\begin{Desc}
\item[Returns:]true if lock successful. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]system-wide lock to use. \end{description}
\end{Desc}
\index{ost::Lockfile@{ost::Lockfile}!unlock@{unlock}}
\index{unlock@{unlock}!ost::Lockfile@{ost::Lockfile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Lockfile::unlock (void)}\label{classost_1_1_lockfile_fb828f1455df52d734b940c7ba8507d2}


Release an acquired lock. 



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