ATLAS Offline Software
Loading...
Searching...
No Matches
RCUUpdater.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 * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
4 */
5// $Id$
12
13
14#ifndef ATHENAKERNEL_RCUUPDATER_H
15#define ATHENAKERNEL_RCUUPDATER_H
16
17
20#include "GaudiKernel/EventContext.h"
21#include "GaudiKernel/ThreadLocalContext.h"
22#include <utility>
23#include <memory>
24
25
26namespace Athena {
27
28
37template <class T>
39{
40public:
42 typedef EventContext Context_t;
43
44
52 template <typename... Args>
53 RCUUpdater (IRCUSvc& rcusvc, Args&&... args);
54
55
64 void update (std::unique_ptr<T> p, const Context_t& ctx);
65
66
70 const T& get() const;
71
72
76 void quiescent (const Context_t& ctx);
77
78
89 void discard (std::unique_ptr<T> p);
90
91
95 static const Context_t& defaultContext();
96
97
98private:
101};
102
103
104} // namespace Athena
105
106
108
109
110#endif // not ATHENAKERNEL_RCUUPDATER_H
read-copy-update (RCU) style synchronization for Athena.
read-copy-update (RCU) style synchronization for Athena.
Interface for RCU service.
Definition IRCUSvc.h:40
Wrapper object controlled by RCU synchonization.
Definition RCUObject.h:312
RCUObject< T > m_obj
The managed object.
Definition RCUUpdater.h:100
void update(std::unique_ptr< T > p, const Context_t &ctx)
Install a new object.
static const Context_t & defaultContext()
Return the current event context.
const T & get() const
Return a reference to the current object.
EventContext Context_t
Execution context type.
Definition RCUUpdater.h:42
RCUUpdater(IRCUSvc &rcusvc, Args &&... args)
Constructor.
void quiescent(const Context_t &ctx)
Mark that an event slot is not referencing this object.
void discard(std::unique_ptr< T > p)
Queue an object for later deletion.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....