Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 94774a05d4f99367afd97b8b4adf565d > files > 993

libfilezilla-devel-0.19.3-1.mga7.armv7hl.rpm

\hypertarget{classfz_1_1thread}{}\section{thread Class Reference}
\label{classfz_1_1thread}\index{thread@{thread}}


Spawns and represents a new thread of execution.  




{\ttfamily \#include $<$thread.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1thread_a6799a0669205fec166ddb0e9711c73af}\label{classfz_1_1thread_a6799a0669205fec166ddb0e9711c73af}} 
typedef std\+::thread\+::id {\bfseries id}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1thread_a626c04c85c7e2b10215bc4a35062f177}\label{classfz_1_1thread_a626c04c85c7e2b10215bc4a35062f177}} 
\mbox{\hyperlink{classfz_1_1thread_a626c04c85c7e2b10215bc4a35062f177}{$\sim$thread}} ()
\begin{DoxyCompactList}\small\item\em Implicitly calls \mbox{\hyperlink{classfz_1_1thread_a6c7abfff648dad193674fc432ad4840d}{join()}} \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classfz_1_1thread_a0907ec7b12192c2e7e40a625570eb7ab}{run}} (std\+::function$<$ void()$>$ \&\&f)
\begin{DoxyCompactList}\small\item\em Start the thread. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfz_1_1thread_a6c7abfff648dad193674fc432ad4840d}{join}} ()
\begin{DoxyCompactList}\small\item\em Join the thread. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classfz_1_1thread_a9c236c9b81b11276bb68f3e3cda1b82b}{joinable}} () const
\begin{DoxyCompactList}\small\item\em A thread is joinable after having been started and before it has been joined. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1thread_aaa0901b558e65d118b1f0345bab26409}\label{classfz_1_1thread_aaa0901b558e65d118b1f0345bab26409}} 
static id \mbox{\hyperlink{classfz_1_1thread_aaa0901b558e65d118b1f0345bab26409}{own\+\_\+id}} ()
\begin{DoxyCompactList}\small\item\em Returns unique id of the thread calling the function. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1thread_adb9ad5cd0f39088a4d8529b9429702fa}\label{classfz_1_1thread_adb9ad5cd0f39088a4d8529b9429702fa}} 
class {\bfseries impl}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Spawns and represents a new thread of execution. 

This is a replacement of std\+::thread. Unfortunately std\+::thread isn\textquotesingle{}t implemented on all Min\+GW flavors. Most notably, Min\+GW as shipped by Debian Jessie does not have std\+::thread.

This class only supports joinable threads.

\begin{DoxyRemark}{Remarks}
Detached threads aren\textquotesingle{}t implemented since they essentially race conditions by design. You cannot use a detached thread and shutdown your program cleanly. 
\end{DoxyRemark}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{classfz_1_1thread_a6c7abfff648dad193674fc432ad4840d}\label{classfz_1_1thread_a6c7abfff648dad193674fc432ad4840d}} 
\index{thread@{thread}!join@{join}}
\index{join@{join}!thread@{thread}}
\subsubsection{\texorpdfstring{join()}{join()}}
{\footnotesize\ttfamily void join (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Join the thread. 

join blocks until the spawn thread has quit.

You must call this at the latest in the destructor of the most-\/derived class.

Must not be called from the spawned thread.

After a successful join you can call \mbox{\hyperlink{classfz_1_1thread_a0907ec7b12192c2e7e40a625570eb7ab}{run}} again to spawn another thread. \mbox{\Hypertarget{classfz_1_1thread_a9c236c9b81b11276bb68f3e3cda1b82b}\label{classfz_1_1thread_a9c236c9b81b11276bb68f3e3cda1b82b}} 
\index{thread@{thread}!joinable@{joinable}}
\index{joinable@{joinable}!thread@{thread}}
\subsubsection{\texorpdfstring{joinable()}{joinable()}}
{\footnotesize\ttfamily bool joinable (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



A thread is joinable after having been started and before it has been joined. 

Must not be called from the spawned thread. \mbox{\Hypertarget{classfz_1_1thread_a0907ec7b12192c2e7e40a625570eb7ab}\label{classfz_1_1thread_a0907ec7b12192c2e7e40a625570eb7ab}} 
\index{thread@{thread}!run@{run}}
\index{run@{run}!thread@{thread}}
\subsubsection{\texorpdfstring{run()}{run()}}
{\footnotesize\ttfamily bool run (\begin{DoxyParamCaption}\item[{std\+::function$<$ void()$>$ \&\&}]{f }\end{DoxyParamCaption})}



Start the thread. 

If a thread has already been started and not yet joined, this function fails. 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{thread_8hpp}{thread.\+hpp}}\end{DoxyCompactItemize}