5 #include "tbb/task_scheduler_init.h" 12 std::weak_ptr<TPoolManager> &
GetWP()
14 static std::weak_ptr<TPoolManager> weak_sched;
27 nThreads = nThreads != 0 ? nThreads : tbb::task_scheduler_init::default_num_threads();
28 fSched ->initialize(nThreads);
51 if (
GetWP().expired()) {
52 std::shared_ptr<TPoolManager> shared(
new TPoolManager(nThreads));
54 return GetWP().lock();
56 return GetWP().lock();
Namespace for new ROOT classes and functions.
TPoolManager(UInt_t nThreads=0)
Initializes the scheduler within ROOT.
tbb::task_scheduler_init * fSched
std::weak_ptr< TPoolManager > & GetWP()
static UInt_t GetPoolSize()
Returns the number of threads running when the scheduler has been instantiated within ROOT...
~TPoolManager()
Terminates the scheduler instantiated within ROOT.
friend std::shared_ptr< TPoolManager > GetPoolManager(UInt_t nThreads)
Get a shared pointer to the manager.