ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaServices
src
RCUSvc.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3
/*
4
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5
*/
6
13
14
15
#ifndef ATHENASERVICES_RCUSVC_H
16
#define ATHENASERVICES_RCUSVC_H
17
18
19
#include "
AthenaKernel/IRCUSvc.h
"
20
#include "
AthenaBaseComps/AthService.h
"
21
#include "GaudiKernel/ServiceHandle.h"
22
#include "GaudiKernel/IHiveWhiteBoard.h"
23
#include "GaudiKernel/IIncidentSvc.h"
24
#include "GaudiKernel/IIncidentListener.h"
25
#include <unordered_map>
26
#include <mutex>
27
28
29
namespace
Athena
{
30
31
39
class
RCUSvc
40
:
public
extends<AthService, IRCUSvc, IIncidentListener>
41
{
42
public
:
48
RCUSvc
(
const
std::string& name, ISvcLocator* svc);
49
50
54
virtual
StatusCode
initialize
()
override
;
55
56
60
virtual
size_t
getNumSlots
()
const override
;
61
62
67
virtual
void
add
(
IRCUObject
* obj)
override
;
68
69
76
virtual
StatusCode
remove
(
IRCUObject
* obj)
override
;
77
78
84
virtual
void
handle
(
const
Incident& inc)
override
;
85
86
87
private
:
89
typedef
std::unordered_set<IRCUObject*>
set_t
;
90
set_t
m_objs
;
91
93
ServiceHandle<IInterface>
m_hiveWhiteBoardSvc
;
94
96
ServiceHandle<IIncidentSvc>
m_incidentSvc
;
97
99
// Needs to be recursive since when handle() quiesces objects,
100
// it can lead to calls to remove().
101
std::recursive_mutex
m_mutex
;
102
typedef
std::lock_guard<std::recursive_mutex>
lock_t
;
103
};
104
105
106
}
// namespace Athena
107
108
109
#endif
// not ATHENASERVICES_RCUSVC_H
AthService.h
IRCUSvc.h
read-copy-update (RCU) style synchronization for Athena.
Athena::IRCUObject
Base object class for RCU-style synchronization for Athena.
Definition
RCUObject.h:147
Athena::RCUSvc::RCUSvc
RCUSvc(const std::string &name, ISvcLocator *svc)
Standard Gaudi constructor.
Definition
RCUSvc.cxx:24
Athena::RCUSvc::m_hiveWhiteBoardSvc
ServiceHandle< IInterface > m_hiveWhiteBoardSvc
The hive WB service. Used to get the current number of slots.
Definition
RCUSvc.h:93
Athena::RCUSvc::getNumSlots
virtual size_t getNumSlots() const override
Return the current number of event slots.
Definition
RCUSvc.cxx:51
Athena::RCUSvc::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition
RCUSvc.cxx:37
Athena::RCUSvc::m_mutex
std::recursive_mutex m_mutex
Mutex protecting access to m_objs.
Definition
RCUSvc.h:101
Athena::RCUSvc::add
virtual void add(IRCUObject *obj) override
Add a new RCU object to the set being managed.
Definition
RCUSvc.cxx:67
Athena::RCUSvc::m_objs
set_t m_objs
Definition
RCUSvc.h:90
Athena::RCUSvc::set_t
std::unordered_set< IRCUObject * > set_t
Set of managed objects.
Definition
RCUSvc.h:89
Athena::RCUSvc::remove
virtual StatusCode remove(IRCUObject *obj) override
Remove an RCU object to the set being managed.
Definition
RCUSvc.cxx:80
Athena::RCUSvc::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Gaudi incident service.
Definition
RCUSvc.h:96
Athena::RCUSvc::lock_t
std::lock_guard< std::recursive_mutex > lock_t
Definition
RCUSvc.h:102
Athena::RCUSvc::handle
virtual void handle(const Incident &inc) override
Gaudi incident handler.
Definition
RCUSvc.cxx:96
ServiceHandle
Definition
ClusterMakerTool.h:36
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
Generated on
for ATLAS Offline Software by
1.17.0