\hypertarget{structefl_1_1eina_1_1thread}{\section{efl\+:\+:eina\+:\+:thread Struct Reference}
\label{structefl_1_1eina_1_1thread}\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}}
}


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


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef \hyperlink{structefl_1_1eina_1_1thread__id}{thread\+\_\+id} \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{id}
\begin{DoxyCompactList}\small\item\em Type for the thread identifier. \end{DoxyCompactList}\item 
typedef \hyperlink{group__Eina__Thread__Group_ga1e85dc4b7b825ef36a5ae9d8b710523a}{Eina\+\_\+\+Thread} \hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{native\+\_\+handle\+\_\+type}
\begin{DoxyCompactList}\small\item\em Type for the native Eina\+\_\+\+Thread handle. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}{\hyperlink{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}{thread} () noexcept}\label{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}

\begin{DoxyCompactList}\small\item\em Creates a thread object that does not represent any thread of execution. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename F , class... Args$>$ }\\\hyperlink{structefl_1_1eina_1_1thread_a31d188e8bf5f596a0147fd34813aa9b1}{thread} (F \&\&f, Args \&\&...args)
\begin{DoxyCompactList}\small\item\em Creates a thread of execution. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}{thread} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&other)
\begin{DoxyCompactList}\small\item\em Move constructor. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread}{thread} \& \hyperlink{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}{operator=} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&other)
\begin{DoxyCompactList}\small\item\em Transfer the thread of execution. \end{DoxyCompactList}\item 
\hypertarget{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}{\hyperlink{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}{$\sim$thread} ()}\label{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}

\begin{DoxyCompactList}\small\item\em Destroys the thread object. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}{swap} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&other) noexcept
\begin{DoxyCompactList}\small\item\em Exchanges the underlying handles of two thread objects. \end{DoxyCompactList}\item 
bool \hyperlink{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}{joinable} () const noexcept
\begin{DoxyCompactList}\small\item\em Check if the thread object identifies an active thread of execution. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a0e1729a168d44421cf4fcdb67636fb4a}{join} ()
\begin{DoxyCompactList}\small\item\em Wait for the thread to finish its execution. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a8e086bb24eeb164a248bf577f2817370}{detach} ()
\begin{DoxyCompactList}\small\item\em Detaches the thread from its handle, making it runs independently. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{id} \hyperlink{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}{get\+\_\+id} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the identifier of the thread associated with this thread object. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{native\+\_\+handle\+\_\+type} \hyperlink{structefl_1_1eina_1_1thread_a18eb1db4fe82255f1694dfe35f0166b1}{native\+\_\+handle} () const 
\begin{DoxyCompactList}\small\item\em Get a handle for the wrapped {\ttfamily Eina\+\_\+\+Thread}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static unsigned \hyperlink{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}{hardware\+\_\+concurrency} () noexcept
\begin{DoxyCompactList}\small\item\em Get the number of hardware concurrent threads. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

This class implements threads in a way that strongly resembles the S\+T\+L {\ttfamily std\+::thread}. 

\subsection{Member Typedef Documentation}
\hypertarget{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!id@{id}}
\index{id@{id}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{id}]{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf thread\+\_\+id} {\bf efl\+::eina\+::thread\+::id}}}\label{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}


Type for the thread identifier. 

\hypertarget{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}}
\index{native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{native\+\_\+handle\+\_\+type}]{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf Eina\+\_\+\+Thread} {\bf efl\+::eina\+::thread\+::native\+\_\+handle\+\_\+type}}}\label{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}


Type for the native Eina\+\_\+\+Thread handle. 



\subsection{Constructor \& Destructor Documentation}
\hypertarget{structefl_1_1eina_1_1thread_a31d188e8bf5f596a0147fd34813aa9b1}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!thread@{thread}}
\index{thread@{thread}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{thread}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename F , class... Args$>$ efl\+::eina\+::thread\+::thread (
\begin{DoxyParamCaption}
\item[{F \&\&}]{f, }
\item[{Args \&\&...}]{args}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}}\label{structefl_1_1eina_1_1thread_a31d188e8bf5f596a0147fd34813aa9b1}


Creates a thread of execution. 


\begin{DoxyParams}{Parameters}
{\em f} & Pointer to function or callable object to execute in the new thread. The return value (if any) is ignored. \\
\hline
{\em args} & Arguments to pass to the {\ttfamily f}.\\
\hline
\end{DoxyParams}
This constructor creates a thread object that represents a thread of execution. The new thread of execution calls {\ttfamily f} passing {\ttfamily args} as arguments (all arguments are copied/moved to thread-\/accessible storage).

Any exceptions thrown during evaluation and copying/moving of the arguments are thrown in the current thread, not the new thread. 

References eina\+\_\+condition\+\_\+free(), eina\+\_\+condition\+\_\+new(), eina\+\_\+condition\+\_\+wait(), eina\+\_\+lock\+\_\+free(), eina\+\_\+lock\+\_\+new(), eina\+\_\+lock\+\_\+release(), E\+I\+N\+A\+\_\+\+L\+O\+C\+K\+\_\+\+S\+U\+C\+C\+E\+E\+D, eina\+\_\+lock\+\_\+take(), eina\+\_\+thread\+\_\+create(), and efl\+::eina\+::get\+\_\+error\+\_\+code().

\hypertarget{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!thread@{thread}}
\index{thread@{thread}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{thread}]{\setlength{\rightskip}{0pt plus 5cm}efl\+::eina\+::thread\+::thread (
\begin{DoxyParamCaption}
\item[{{\bf thread} \&\&}]{other}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}


Move constructor. 

Transfer the thread of execution to the new object. 
\begin{DoxyParams}{Parameters}
{\em other} & Another thread object to construct this thread object with.\\
\hline
\end{DoxyParams}
This constructor creates a thread object that acquires the thread of execution represented by {\ttfamily other}. This operation does not affect the execution of the moved thread, it simply transfers its handler.

\begin{DoxyNote}{Note}
After this call {\ttfamily other} no longer represents a thread of execution. 
\end{DoxyNote}


\subsection{Member Function Documentation}
\hypertarget{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!operator=@{operator=}}
\index{operator=@{operator=}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{operator=}]{\setlength{\rightskip}{0pt plus 5cm}{\bf thread}\& efl\+::eina\+::thread\+::operator= (
\begin{DoxyParamCaption}
\item[{{\bf thread} \&\&}]{other}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}


Transfer the thread of execution. 


\begin{DoxyParams}{Parameters}
{\em other} & Another thread object to assign to this thread object. \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
After this call {\ttfamily other} no longer represents a thread of execution. 
\end{DoxyNote}
\hypertarget{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!swap@{swap}}
\index{swap@{swap}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{swap}]{\setlength{\rightskip}{0pt plus 5cm}void efl\+::eina\+::thread\+::swap (
\begin{DoxyParamCaption}
\item[{{\bf thread} \&}]{other}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}}\label{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}


Exchanges the underlying handles of two thread objects. 


\begin{DoxyParams}{Parameters}
{\em other} & Another thread object. \\
\hline
\end{DoxyParams}


References efl\+::eina\+::swap().



Referenced by efl\+::eina\+::swap().

\hypertarget{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!joinable@{joinable}}
\index{joinable@{joinable}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{joinable}]{\setlength{\rightskip}{0pt plus 5cm}bool efl\+::eina\+::thread\+::joinable (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}}\label{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}


Check if the thread object identifies an active thread of execution. 

\begin{DoxyReturn}{Returns}
{\ttfamily true} if the thread object identifies an active thread of execution, {\ttfamily false} otherwise.
\end{DoxyReturn}
This member function checks if the thread object identifies an active thread of execution. A default constructed thread is not joinable, as well as a thread that its members join or detach has been called.

A thread that has finished executing code, but has not yet been joined is still considered an active thread of execution and is therefore joinable. 

Referenced by detach(), join(), and $\sim$thread().

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


Wait for the thread to finish its execution. 

This member function blocks the calling thread until the thread identified by this object finishes its execution.

\begin{DoxyNote}{Note}
A joinable thread becomes not joinable after a call to this function. 
\end{DoxyNote}


References eina\+\_\+thread\+\_\+join(), and joinable().

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


Detaches the thread from its handle, making it runs independently. 

This member function separates the thread of execution from the thread object, allowing execution to continue independently.

\begin{DoxyNote}{Note}
After a call to this function, the thread object becomes non-\/joinable. 
\end{DoxyNote}


References joinable().

\hypertarget{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!get\+\_\+id@{get\+\_\+id}}
\index{get\+\_\+id@{get\+\_\+id}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{get\+\_\+id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf id} efl\+::eina\+::thread\+::get\+\_\+id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}}\label{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}


Returns the identifier of the thread associated with this thread object. 

\begin{DoxyReturn}{Returns}
{\ttfamily \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{thread\+::id}} identifying the thread associated with this thread object. 
\end{DoxyReturn}
\hypertarget{structefl_1_1eina_1_1thread_a18eb1db4fe82255f1694dfe35f0166b1}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!native\+\_\+handle@{native\+\_\+handle}}
\index{native\+\_\+handle@{native\+\_\+handle}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{native\+\_\+handle}]{\setlength{\rightskip}{0pt plus 5cm}{\bf native\+\_\+handle\+\_\+type} efl\+::eina\+::thread\+::native\+\_\+handle (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{structefl_1_1eina_1_1thread_a18eb1db4fe82255f1694dfe35f0166b1}


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

\begin{DoxyReturn}{Returns}
Handle for the native {\ttfamily Eina\+\_\+\+Thread}.
\end{DoxyReturn}
This member function returns the native {\ttfamily Eina\+\_\+\+Thread} handle that is wrapped inside this object. \hypertarget{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}{\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!hardware\+\_\+concurrency@{hardware\+\_\+concurrency}}
\index{hardware\+\_\+concurrency@{hardware\+\_\+concurrency}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection[{hardware\+\_\+concurrency}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned efl\+::eina\+::thread\+::hardware\+\_\+concurrency (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}, {\ttfamily [noexcept]}}}\label{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}


Get the number of hardware concurrent threads. 

\begin{DoxyReturn}{Returns}
A hint on the number of hardware concurrent threads, or {\ttfamily 0} if the value is not well defined or not computable.
\end{DoxyReturn}
This static member function returns the number of hardware concurrent threads.

\begin{DoxyNote}{Note}
The interpretation of this value is implementation-\/specific, and may be just an approximation. 
\end{DoxyNote}


References eina\+\_\+cpu\+\_\+count().

