The Gaudi Framework  v33r0 (d5ea422b)
ThreadInitTask.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIHIVE_THREADINITTASK_H
12 #define GAUDIHIVE_THREADINITTASK_H
13 
16 #include "GaudiKernel/SmartIF.h"
17 #include "GaudiKernel/ToolHandle.h"
18 
19 #include "boost/thread.hpp"
20 #include "tbb/task.h"
21 #include <string>
22 #include <vector>
23 
31 class ThreadInitTask : virtual public tbb::task
32 
33 {
34 
35 public:
37  bool terminate = false )
38  : m_tools( tools ), m_barrier( b ), m_serviceLocator( svcLocator ), m_terminate( terminate ){};
39 
44  tbb::task* execute() override;
45 
46  static bool execFailed() { return m_execFailed; }
47 
48 private:
50 
51  boost::barrier* m_barrier = nullptr;
53  bool m_terminate = false;
54 
56 };
57 
58 #endif
ThreadInitTask(ToolHandleArray< IThreadInitTool > &tools, boost::barrier *b, ISvcLocator *svcLocator, bool terminate=false)
tbb::task * execute() override
Execute the task.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:35
SmartIF< ISvcLocator > m_serviceLocator
static std::atomic< bool > m_execFailed
Special TBB task used by ThreadPoolSvc to wrap execution of IThreadInitTools.
GAUDI_API ISvcLocator * svcLocator()
static bool execFailed()
ToolHandleArray< IThreadInitTool > m_tools
boost::barrier * m_barrier