\hypertarget{structefl_1_1eina_1_1mutex}{\section{efl\+:\+:eina\+:\+:mutex Struct Reference}
\label{structefl_1_1eina_1_1mutex}\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
}


Provides an O\+O\+P interface to the {\ttfamily Eina\+\_\+\+Lock} and automatic resource allocation and deallocation using the R\+A\+I\+I programming idiom.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef Eina\+\_\+\+Lock $\ast$ \hyperlink{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{native\+\_\+handle\+\_\+type}
\begin{DoxyCompactList}\small\item\em Type for the native Eina\+\_\+\+Lock pointer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structefl_1_1eina_1_1mutex_a8990745be53aa41bf6ea02aef89ccb30}{mutex} ()
\begin{DoxyCompactList}\small\item\em Create a new mutex. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1mutex_a3a102a623265e232a41c21b0020aca33}{$\sim$mutex} ()
\begin{DoxyCompactList}\small\item\em Release mutex resources. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}{lock} ()
\begin{DoxyCompactList}\small\item\em Lock the mutex. \end{DoxyCompactList}\item 
bool \hyperlink{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}{try\+\_\+lock} ()
\begin{DoxyCompactList}\small\item\em Attempts to lock the mutex. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1mutex_a4f39e7b56bff8c32edd3e7392159992a}{unlock} ()
\begin{DoxyCompactList}\small\item\em Unlock the lock. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1mutex_a8fb3e1334bfe8f9ab984961822c5841c}{debug} ()
\begin{DoxyCompactList}\small\item\em Print debug information about the mutex. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{native\+\_\+handle\+\_\+type} \hyperlink{structefl_1_1eina_1_1mutex_ad9248f8fb45d4e03412657dc268d3436}{native\+\_\+handle} ()
\begin{DoxyCompactList}\small\item\em Get a handle for the wrapped {\ttfamily Eina\+\_\+\+Lock}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Provides an O\+O\+P interface to the {\ttfamily Eina\+\_\+\+Lock} and automatic resource allocation and deallocation using the R\+A\+I\+I programming idiom. 

This class implements mutual exclusion variables (mutexes) in a way that strongly resembles the S\+T\+L {\ttfamily std\+::mutex}. 

\subsection{Member Typedef Documentation}
\hypertarget{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}}
\index{native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{native\+\_\+handle\+\_\+type}]{\setlength{\rightskip}{0pt plus 5cm}typedef Eina\+\_\+\+Lock$\ast$ {\bf efl\+::eina\+::mutex\+::native\+\_\+handle\+\_\+type}}}\label{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}


Type for the native Eina\+\_\+\+Lock pointer. 



\subsection{Constructor \& Destructor Documentation}
\hypertarget{structefl_1_1eina_1_1mutex_a8990745be53aa41bf6ea02aef89ccb30}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!mutex@{mutex}}
\index{mutex@{mutex}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{mutex}]{\setlength{\rightskip}{0pt plus 5cm}efl\+::eina\+::mutex\+::mutex (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_a8990745be53aa41bf6ea02aef89ccb30}


Create a new mutex. 

Automatically allocates a new mutex and does any platform dependent initialization that is required. 

References eina\+\_\+lock\+\_\+new().

\hypertarget{structefl_1_1eina_1_1mutex_a3a102a623265e232a41c21b0020aca33}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!````~mutex@{$\sim$mutex}}
\index{````~mutex@{$\sim$mutex}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{$\sim$mutex}]{\setlength{\rightskip}{0pt plus 5cm}efl\+::eina\+::mutex\+::$\sim$mutex (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_a3a102a623265e232a41c21b0020aca33}


Release mutex resources. 

Automatically deallocates the mutex and does any platform dependent cleanup that is required. 

References eina\+\_\+lock\+\_\+free().



\subsection{Member Function Documentation}
\hypertarget{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!lock@{lock}}
\index{lock@{lock}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{lock}]{\setlength{\rightskip}{0pt plus 5cm}void efl\+::eina\+::mutex\+::lock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}


Lock the mutex. 


\begin{DoxyExceptions}{Exceptions}
{\em $<$tt$>$eina\+::system\+\_\+error$<$/tt$>$} & with the code {\ttfamily eina\+::errc\+::resource\+\_\+deadlock\+\_\+would\+\_\+occur} if the operation fails because a deadlock condition exists. If some other condition causes the lock to fail (other than the mutex being already locked) the error code will be an internal Eina error code.\\
\hline
\end{DoxyExceptions}
This member function locks the mutex. If the mutex is locked already, this call will block until the lock is released. This is appropriate in many cases, but consider using \hyperlink{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}{try\+\_\+lock()} if you don't need to block. 

References E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+A\+D\+L\+O\+C\+K, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+E\+D, eina\+\_\+lock\+\_\+take(), efl\+::eina\+::get\+\_\+error\+\_\+code(), and efl\+::eina\+::get\+\_\+generic\+\_\+category().

\hypertarget{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!try\+\_\+lock@{try\+\_\+lock}}
\index{try\+\_\+lock@{try\+\_\+lock}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{try\+\_\+lock}]{\setlength{\rightskip}{0pt plus 5cm}bool efl\+::eina\+::mutex\+::try\+\_\+lock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}


Attempts to lock the mutex. 

\begin{DoxyReturn}{Returns}
{\ttfamily true} if it succeed in locking the mutex, {\ttfamily false} otherwise. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em $<$tt$>$eina\+::system\+\_\+error$<$/tt$>$} & with the code {\ttfamily eina\+::errc\+::resource\+\_\+deadlock\+\_\+would\+\_\+occur} if the operation fails because a deadlock condition exists. If some other condition causes the lock to fail (other than the mutex being already locked) the error code will be an internal Eina error code.\\
\hline
\end{DoxyExceptions}
This member function attempts to lock the mutex, identical to \hyperlink{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}{lock()}, but returns immediately if the mutex is already locked. 

References E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+A\+D\+L\+O\+C\+K, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+F\+A\+I\+L, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+E\+D, eina\+\_\+lock\+\_\+take\+\_\+try(), efl\+::eina\+::get\+\_\+error\+\_\+code(), and efl\+::eina\+::get\+\_\+generic\+\_\+category().

\hypertarget{structefl_1_1eina_1_1mutex_a4f39e7b56bff8c32edd3e7392159992a}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!unlock@{unlock}}
\index{unlock@{unlock}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{unlock}]{\setlength{\rightskip}{0pt plus 5cm}void efl\+::eina\+::mutex\+::unlock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_a4f39e7b56bff8c32edd3e7392159992a}


Unlock the lock. 


\begin{DoxyExceptions}{Exceptions}
{\em $<$tt$>$eina\+::system\+\_\+error$<$/tt$>$} & with the code {\ttfamily eina\+::errc\+::resource\+\_\+deadlock\+\_\+would\+\_\+occur} if the operation fails because a deadlock condition exists. If some other condition causes the lock to fail the error code will be an internal Eina error code.\\
\hline
\end{DoxyExceptions}
This member function will unlock the mutex.

\begin{DoxyNote}{Note}
If successful, and E\+I\+N\+A\+\_\+\+H\+A\+V\+E\+\_\+\+D\+E\+B\+U\+G\+\_\+\+T\+H\+R\+E\+A\+D\+S is defined, the mutex is updated and information about the locking process is removed (e.\+g. thread number and backtrace for P\+O\+S\+I\+X). 
\end{DoxyNote}


References E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+A\+D\+L\+O\+C\+K, eina\+\_\+lock\+\_\+release(), E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+E\+D, efl\+::eina\+::get\+\_\+error\+\_\+code(), and efl\+::eina\+::get\+\_\+generic\+\_\+category().

\hypertarget{structefl_1_1eina_1_1mutex_a8fb3e1334bfe8f9ab984961822c5841c}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!debug@{debug}}
\index{debug@{debug}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{debug}]{\setlength{\rightskip}{0pt plus 5cm}void efl\+::eina\+::mutex\+::debug (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_a8fb3e1334bfe8f9ab984961822c5841c}


Print debug information about the mutex. 

This member function prints debug information for the mutex. The information is platform dependent. On P\+O\+S\+I\+X systems it will print the address of mutex, lock state, thread number and a backtrace. 

References eina\+\_\+lock\+\_\+debug().

\hypertarget{structefl_1_1eina_1_1mutex_ad9248f8fb45d4e03412657dc268d3436}{\index{efl\+::eina\+::mutex@{efl\+::eina\+::mutex}!native\+\_\+handle@{native\+\_\+handle}}
\index{native\+\_\+handle@{native\+\_\+handle}!efl\+::eina\+::mutex@{efl\+::eina\+::mutex}}
\subsubsection[{native\+\_\+handle}]{\setlength{\rightskip}{0pt plus 5cm}{\bf native\+\_\+handle\+\_\+type} efl\+::eina\+::mutex\+::native\+\_\+handle (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1mutex_ad9248f8fb45d4e03412657dc268d3436}


Get a handle for the wrapped {\ttfamily Eina\+\_\+\+Lock}. 

\begin{DoxyReturn}{Returns}
Handle for the native {\ttfamily Eina\+\_\+\+Lock}.
\end{DoxyReturn}
This member function returns the native {\ttfamily Eina\+\_\+\+Lock} handle that is wrapped inside this object.

\begin{DoxyWarning}{Warning}
It is important to take care when using it, since the handle will be automatically released upon object destruction. 
\end{DoxyWarning}


Referenced by efl\+::eina\+::condition\+\_\+variable\+::condition\+\_\+variable().

