Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Control
AthenaExamples
AthExHive
src
ThreadInitTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHEXHIVE_THREADINITTOOL_H
6
#define ATHEXHIVE_THREADINITTOOL_H
7
8
#include "
AthenaBaseComps/AthAlgTool.h
"
9
#include "GaudiKernel/IThreadInitTool.h"
10
11
#include <string>
12
#include <atomic>
13
14
//-------------------------------------------------------------------------------
15
//
16
// This is an example of a Tool that will get executed in every thread by the
17
// ThreadPoolSvc.
18
//
19
// At the beginning of the job, just after the ThreadPool has been created,
20
// the initThread() method of the Tool will be called in each thread.
21
//
22
// as a check, m_nInitThreads MUST be incremented at the end of the initThread()
23
// method.
24
//
25
// At the end of the job, the terminateThread() method will be called.
26
//
27
//-------------------------------------------------------------------------------
28
29
30
class
ThreadInitTool
:
virtual
public
extends<AthAlgTool, IThreadInitTool> {
31
32
public
:
33
ThreadInitTool
(
const
std::string&,
const
std::string&,
const
IInterface* );
34
35
36
virtual
void
initThread
()
override
;
37
virtual
void
terminateThread
()
override
;
38
39
virtual
unsigned
int
nInit
()
const override
{
return
m_nInitThreads
; }
40
41
private
:
42
// Number of threads that have been initialized
43
std::atomic_uint
m_nInitThreads
{0};
44
45
};
46
47
#endif
ThreadInitTool::ThreadInitTool
ThreadInitTool(const std::string &, const std::string &, const IInterface *)
Definition:
ThreadInitTool.cxx:10
ThreadInitTool::terminateThread
virtual void terminateThread() override
Definition:
ThreadInitTool.cxx:32
ThreadInitTool
Definition:
ThreadInitTool.h:30
ThreadInitTool::initThread
virtual void initThread() override
Definition:
ThreadInitTool.cxx:19
AthAlgTool.h
ThreadInitTool::m_nInitThreads
std::atomic_uint m_nInitThreads
Definition:
ThreadInitTool.h:43
ThreadInitTool::nInit
virtual unsigned int nInit() const override
Definition:
ThreadInitTool.h:39
Generated on Fri May 9 2025 21:19:50 for ATLAS Offline Software by
1.8.18