ATLAS Offline Software
G4ThreadInitTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASTOOLS_G4THREADINITTOOL_H
6 #define G4ATLASTOOLS_G4THREADINITTOOL_H
7 
9 #include "GaudiKernel/IThreadInitTool.h"
10 
11 #include <string>
12 #include <atomic>
13 
19 class G4ThreadInitTool : virtual public extends<AthAlgTool, IThreadInitTool>
20 {
21 
22  public:
23 
25  G4ThreadInitTool(const std::string&, const std::string&, const IInterface*);
26 
28  virtual void initThread() override final;
29 
31  virtual void terminateThread() override final;
32 
36  virtual unsigned int nInit() const override final {
37  return m_nInitThreads;
38  }
39 
40  private:
41 
43  std::atomic_uint m_nInitThreads;
44 
45 }; // class G4ThreadInitTool
46 
47 #endif // G4ATLASTOOLS_G4THREADINITTOOL_H
G4ThreadInitTool::m_nInitThreads
std::atomic_uint m_nInitThreads
Counter of threads that have been initialized.
Definition: G4ThreadInitTool.h:43
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
G4ThreadInitTool::terminateThread
virtual void terminateThread() override final
Tear down the Geant4 workspace for this worker thread.
Definition: G4ThreadInitTool.cxx:118
G4ThreadInitTool
A tool which sets up the worker-thread-local workspace for Geant4.
Definition: G4ThreadInitTool.h:20
G4ThreadInitTool::nInit
virtual unsigned int nInit() const override final
Counter used for barrier mechanism in thread initialization.
Definition: G4ThreadInitTool.h:36
AthAlgTool.h
G4ThreadInitTool::initThread
virtual void initThread() override final
Set up the Geant4 workspace for this worker thread.
Definition: G4ThreadInitTool.cxx:38
G4ThreadInitTool::G4ThreadInitTool
G4ThreadInitTool(const std::string &, const std::string &, const IInterface *)
Standard tool constructor.
Definition: G4ThreadInitTool.cxx:27