The Gaudi Framework
master (37c0b60a)
ThreadInitTask.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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
14
#include <
GaudiKernel/ISvcLocator.h
>
15
#include <
GaudiKernel/IThreadInitTool.h
>
16
#include <
GaudiKernel/SmartIF.h
>
17
#include <
GaudiKernel/ToolHandle.h
>
18
19
#include <boost/thread.hpp>
20
#include <string>
21
#include <vector>
22
30
class
ThreadInitTask
{
31
32
public
:
33
ThreadInitTask
(
ToolHandleArray<IThreadInitTool>
& tools, boost::barrier* b,
ISvcLocator
*
svcLocator
,
34
bool
terminate =
false
)
35
:
m_tools
( tools ),
m_barrier
( b ),
m_serviceLocator
(
svcLocator
),
m_terminate
( terminate ){};
36
41
void
operator()
()
const
;
42
43
static
bool
execFailed
() {
return
m_execFailed
; }
44
45
private
:
46
ToolHandleArray<IThreadInitTool>
m_tools
;
47
48
boost::barrier*
m_barrier
=
nullptr
;
49
SmartIF<ISvcLocator>
m_serviceLocator
;
50
bool
m_terminate
=
false
;
51
52
static
std::atomic<bool>
m_execFailed
;
53
};
54
55
#endif
IThreadInitTool.h
ISvcLocator
Definition:
ISvcLocator.h:46
ThreadInitTask::m_serviceLocator
SmartIF< ISvcLocator > m_serviceLocator
Definition:
ThreadInitTask.h:49
ThreadInitTask::execFailed
static bool execFailed()
Definition:
ThreadInitTask.h:43
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
SmartIF.h
ThreadInitTask::m_barrier
boost::barrier * m_barrier
Definition:
ThreadInitTask.h:48
ToolHandleArray< IThreadInitTool >
ThreadInitTask::operator()
void operator()() const
Execute the task.
Definition:
ThreadInitTask.cpp:28
SmartIF< ISvcLocator >
std::atomic< bool >
ThreadInitTask
Special TBB task used by ThreadPoolSvc to wrap execution of IThreadInitTools.
Definition:
ThreadInitTask.h:30
ToolHandle.h
ThreadInitTask::ThreadInitTask
ThreadInitTask(ToolHandleArray< IThreadInitTool > &tools, boost::barrier *b, ISvcLocator *svcLocator, bool terminate=false)
Definition:
ThreadInitTask.h:33
ISvcLocator.h
ThreadInitTask::m_terminate
bool m_terminate
Definition:
ThreadInitTask.h:50
ThreadInitTask::m_tools
ToolHandleArray< IThreadInitTool > m_tools
Definition:
ThreadInitTask.h:46
ThreadInitTask::m_execFailed
static std::atomic< bool > m_execFailed
Definition:
ThreadInitTask.h:52
GaudiHive
src
ThreadInitTask.h
Generated on Thu Dec 19 2024 15:35:00 for The Gaudi Framework by
1.8.18