ATLAS Offline Software
Loading...
Searching...
No Matches
pool.h File Reference
#include <functional>
#include <vector>
Include dependency graph for PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

using WorkUnit = std::function<void(void)>
using WorkList = std::vector<WorkUnit>

Functions

void process (const WorkList &workList, const size_t nThreads)

Typedef Documentation

◆ WorkList

using WorkList = std::vector<WorkUnit>

◆ WorkUnit

using WorkUnit = std::function<void(void)>

Function Documentation

◆ process()

void process ( const WorkList & workList,
const size_t nThreads )

Definition at line 44 of file pool.cxx.

45{
46 WorkList_cit begin(std::begin(workList)), end(std::end(workList));
47 if (nThreads == 0) {
48 worker(begin, end);
49 } else {
50 Threads(nThreads, [&](){ worker(begin, end); });
51 }
52}