31 bool runTask(
EProc ) {
36 unsigned long threadID()
const {
45 void threadPool(
size_t _numThreads = 10,
bool _needDbg =
false)
47 cout <<
"ThreadPool: starting..." << endl;
57 vector <TTestTask> tasksList(numTasks);
59 cout <<
"ThreadPool: getting tasks..." << endl;
60 cout <<
"ThreadPool: processing tasks..." << endl;
63 for (
size_t i = 0; i < numTasks; ++i) {
70 threadPool.
Stop(
true);
71 cout <<
"ThreadPool: done" << endl;
RooArgList L(const RooAbsArg &v1)
static Long_t SelfId()
Static method returning the id for the current thread.
void PushTask(typename TThreadPoolTask< aTask, aParam >::task_t &task, aParam param)
void threadPool(size_t _numThreads=10, bool _needDbg=false)
void Stop(bool processRemainingJobs=false)
static Int_t Sleep(ULong_t secs, ULong_t nanos=0)
Static method to sleep the calling thread.