The Gaudi Framework master (934d2c3c)
Loading...
Searching...
No Matches
ThreadInitTask.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2026 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#pragma once
12
13// Framework includes
16#include <GaudiKernel/SmartIF.h>
18
19// STL includes
20#include <atomic>
21#include <barrier>
22#include <vector>
23
30
32
33public:
34 ThreadInitTask( ToolHandleArray<IThreadInitTool>& tools, std::barrier<>* b, ISvcLocator* svcLocator,
35 bool terminate = false )
36 : m_barrier( b ), m_serviceLocator( svcLocator ), m_terminate( terminate ) {
37 m_tools.reserve( tools.size() );
38 for ( auto& tool : tools ) { m_tools.push_back( tool.get() ); }
39 }
40
45 void operator()() const;
46
47 static bool execFailed() { return m_execFailed; }
48
49private:
51
52 std::barrier<>* m_barrier = nullptr;
54 bool m_terminate = false;
55
57};
void terminate() noexcept
constexpr void push_back(const value_type &__x)
constexpr void reserve(size_type __n)
size_type size() const
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
static bool execFailed()
std::barrier * m_barrier
SmartIF< ISvcLocator > m_serviceLocator
std::vector< IThreadInitTool * > m_tools
static std::atomic< bool > m_execFailed
ThreadInitTask(ToolHandleArray< IThreadInitTool > &tools, std::barrier<> *b, ISvcLocator *svcLocator, bool terminate=false)
void operator()() const
Execute the task.
Array of Handles to be used in lieu of vector of naked pointers to tools.
Definition ToolHandle.h:396