\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\+OP interface to the {\ttfamily Eina\+\_\+\+Lock} and automatic resource allocation and deallocation using the R\+A\+II programming idiom.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef Eina\+\_\+\+Lock $\ast$ \mbox{\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 
\mbox{\hyperlink{structefl_1_1eina_1_1mutex_a8990745be53aa41bf6ea02aef89ccb30}{mutex}} ()
\begin{DoxyCompactList}\small\item\em Create a new mutex. \end{DoxyCompactList}\item 
\mbox{\hyperlink{structefl_1_1eina_1_1mutex_a3a102a623265e232a41c21b0020aca33}{$\sim$mutex}} ()
\begin{DoxyCompactList}\small\item\em Release mutex resources. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}{lock}} ()
\begin{DoxyCompactList}\small\item\em Lock the mutex. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}{try\+\_\+lock}} ()
\begin{DoxyCompactList}\small\item\em Attempts to lock the mutex. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a4f39e7b56bff8c32edd3e7392159992a}{unlock}} ()
\begin{DoxyCompactList}\small\item\em Unlock the lock. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a8fb3e1334bfe8f9ab984961822c5841c}{debug}} ()
\begin{DoxyCompactList}\small\item\em Print debug information about the mutex. \end{DoxyCompactList}\item 
\mbox{\hyperlink{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{native\+\_\+handle\+\_\+type}} \mbox{\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\+OP interface to the {\ttfamily Eina\+\_\+\+Lock} and automatic resource allocation and deallocation using the R\+A\+II programming idiom. 

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

\subsection{Member Typedef Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}\label{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{\texorpdfstring{native\+\_\+handle\+\_\+type}{native\_handle\_type}}
{\footnotesize\ttfamily typedef Eina\+\_\+\+Lock$\ast$ \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{efl\+::eina\+::mutex\+::native\+\_\+handle\+\_\+type}}}



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



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a8990745be53aa41bf6ea02aef89ccb30}\label{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{\texorpdfstring{mutex()}{mutex()}}
{\footnotesize\ttfamily efl\+::eina\+::mutex\+::mutex (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create a new mutex. 

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

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

\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a3a102a623265e232a41c21b0020aca33}\label{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{\texorpdfstring{$\sim$mutex()}{~mutex()}}
{\footnotesize\ttfamily efl\+::eina\+::mutex\+::$\sim$mutex (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Release mutex resources. 

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

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



\subsection{Member Function Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_ade62e7383a995cac6b4595a89f7a3316}\label{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{\texorpdfstring{lock()}{lock()}}
{\footnotesize\ttfamily void efl\+::eina\+::mutex\+::lock (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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 \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}{try\+\_\+lock()}} if you don\textquotesingle{}t need to block. 

References E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+A\+D\+L\+O\+CK, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+ED, and eina\+\_\+lock\+\_\+take().

\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a5793758ef5f43d2b6dc4f1a81271bd54}\label{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{\texorpdfstring{try\+\_\+lock()}{try\_lock()}}
{\footnotesize\ttfamily bool efl\+::eina\+::mutex\+::try\+\_\+lock (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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 \mbox{\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\+CK, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+F\+A\+IL, E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+ED, and eina\+\_\+lock\+\_\+take\+\_\+try().

\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a4f39e7b56bff8c32edd3e7392159992a}\label{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{\texorpdfstring{unlock()}{unlock()}}
{\footnotesize\ttfamily void efl\+::eina\+::mutex\+::unlock (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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\+DS is defined, the mutex is updated and information about the locking process is removed (e.\+g. thread number and backtrace for P\+O\+S\+IX). 
\end{DoxyNote}


References E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+A\+D\+L\+O\+CK, eina\+\_\+lock\+\_\+release(), and E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+ED.

\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_a8fb3e1334bfe8f9ab984961822c5841c}\label{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{\texorpdfstring{debug()}{debug()}}
{\footnotesize\ttfamily void efl\+::eina\+::mutex\+::debug (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Print debug information about the mutex. 

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

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

\mbox{\Hypertarget{structefl_1_1eina_1_1mutex_ad9248f8fb45d4e03412657dc268d3436}\label{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{\texorpdfstring{native\+\_\+handle()}{native\_handle()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structefl_1_1eina_1_1mutex_a66efe4017d3d8d8b9941c876b99ab100}{native\+\_\+handle\+\_\+type}} efl\+::eina\+::mutex\+::native\+\_\+handle (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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().

