\section{cppcms\-:\-:thread\-\_\-pool Class Reference}
\label{classcppcms_1_1thread__pool}\index{cppcms\-::thread\-\_\-pool@{cppcms\-::thread\-\_\-pool}}


This class provides an access to the thread pool where all Cpp\-C\-M\-S synchronous applications are executed.  




{\ttfamily \#include $<$cppcms/thread\-\_\-pool.\-h$>$}

Inheritance diagram for cppcms\-:\-:thread\-\_\-pool\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classcppcms_1_1thread__pool}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
int {\bf post} ({\bf booster\-::function}$<$ void()$>$ const \&job)
\item 
bool {\bf cancel} (int id)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class provides an access to the thread pool where all Cpp\-C\-M\-S synchronous applications are executed. 

Users of asynchronous applications or tasks my send their jobs for the execution in the \doxyref{thread\-\_\-pool}{p.}{classcppcms_1_1thread__pool} 

\subsection{Member Function Documentation}
\index{cppcms\-::thread\-\_\-pool@{cppcms\-::thread\-\_\-pool}!cancel@{cancel}}
\index{cancel@{cancel}!cppcms::thread_pool@{cppcms\-::thread\-\_\-pool}}
\subsubsection[{cancel}]{\setlength{\rightskip}{0pt plus 5cm}bool cppcms\-::thread\-\_\-pool\-::cancel (
\begin{DoxyParamCaption}
\item[{int}]{id}
\end{DoxyParamCaption}
)}\label{classcppcms_1_1thread__pool_a2e02f0b576e1dbae4ea23609ee292aba}
Cancel the job using id received from \doxyref{post()}{p.}{classcppcms_1_1thread__pool_a64241f11e253edad29903d847d072b0f} function

Returns true if the job was removed from the queue and false if the operation failed\-: the job execution is in the process or completed

Note\-: the id is just a rolling number and job ids may be repeated once in a while, so it is good idea to check if the job was completed before cancelling the job (even it is unlikely the 4 billion jobs would be executed in small period of time. \index{cppcms\-::thread\-\_\-pool@{cppcms\-::thread\-\_\-pool}!post@{post}}
\index{post@{post}!cppcms::thread_pool@{cppcms\-::thread\-\_\-pool}}
\subsubsection[{post}]{\setlength{\rightskip}{0pt plus 5cm}int cppcms\-::thread\-\_\-pool\-::post (
\begin{DoxyParamCaption}
\item[{{\bf booster\-::function}$<$ void()$>$ const \&}]{job}
\end{DoxyParamCaption}
)}\label{classcppcms_1_1thread__pool_a64241f11e253edad29903d847d072b0f}
Post a request for execution of {\itshape job} in the pool. Received integer is special job identification number that can be used to remove the job from the queue. 

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
cppcms/thread\-\_\-pool.\-h\end{DoxyCompactItemize}
