ATLAS Offline Software
Loading...
Searching...
No Matches
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
19class 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
virtual void terminateThread() override final
Tear down the Geant4 workspace for this worker thread.
virtual unsigned int nInit() const override final
Counter used for barrier mechanism in thread initialization.
std::atomic_uint m_nInitThreads
Counter of threads that have been initialized.
G4ThreadInitTool(const std::string &, const std::string &, const IInterface *)
Standard tool constructor.
virtual void initThread() override final
Set up the Geant4 workspace for this worker thread.