14#include "boost/dynamic_bitset.hpp"
32bool endGrace (
const EventContext& ctx,
33 boost::dynamic_bitset<>& grace)
35 EventContext::ContextID_t slot = ctx.slot();
36 if (slot == EventContext::INVALID_CONTEXT_ID)
return false;
37 if (slot >= grace.size()) std::abort();
104 if (
m_svc &&
m_svc->remove (
this).isFailure())
124 other.m_dirty =
false;
126 if (
m_svc->remove (&other).isFailure()) {
129 other.m_svc =
nullptr;
195 if (garbageSize &&
m_nold == 0) {
read-copy-update (RCU) style synchronization for Athena.
read-copy-update (RCU) style synchronization for Athena.
virtual void clearAll(lock_t &)=0
Delete all objects.
void setGrace(lock_t &)
Declare that all slots are in a grace period.
void makeOld(lock_t &lock, size_t garbageSize)
Make existing pending objects old, if possible.
IRCUSvc * m_svc
The service with which we're registered, or null.
std::atomic< bool > m_dirty
True if there are any objects pending deletion.
IRCUObject(IRCUSvc &svc)
Constructor, with RCUSvc.
virtual bool clearOld(lock_t &, size_t nold)=0
Delete old objects.
std::unique_lock< mutex_t > lock_t
bool endGrace(lock_t &lock, const EventContext &ctx)
Declare that the grace period for a slot is ending.
std::mutex m_mutex
The mutex for this object.
void quiescentOol(const EventContext &ctx)
Out-of-line part of quiescent().
virtual ~IRCUObject()
Destructor.
std::unique_ptr< RCUObjectGraceSets > m_graceSets
Holds the current and old grace period bitmasks.
size_t m_nold
Number of old objects.
Interface for RCU service.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
boost::dynamic_bitset m_grace
Bit[i] set means that slot i is in a grace period.
boost::dynamic_bitset m_oldGrace
Same thing, for the objects marked as old.
RCUObjectGraceSets(size_t nslots)