31 #include <boost/lexical_cast.hpp>
34 using boost::lexical_cast;
49 volatile bool * marca_de_final)
50 : tasques(q), terminat_(marca_de_final)
52 assert( 0 != terminat_ );
56 : tasques(wt.tasques), terminat_(wt.terminat_)
58 assert( 0 != terminat_ );
62 using boost::posix_time::milliseconds;
64 assert( 0 != terminat_ );
65 while (! *terminat_) {
85 ThreadPool::ThreadPool(
const size_t num_threads)
86 : n_threads_(num_threads), tancada_(false), marca_terminacio_(false)
105 tasques_.push(tasca);
124 boost::this_thread::sleep(boost::posix_time::milliseconds(
INTERVAL_POLLING));