ATLAS Offline Software
Loading...
Searching...
No Matches
IDC_WriteHandleBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8
9using namespace EventContainers;
10
11
12
14
15//If object has not been filled this will change state to aborted
16//If object has been filled this should do nothing
18 if(m_atomic==nullptr) return;
19//Convenience declarations
20 const void* waitstate = std::bit_cast<const void*>(IdentifiableCacheBase::INVALIDflag);
21 const void* ABORTstate = std::bit_cast<const void*>(IdentifiableCacheBase::ABORTEDflag);
22
23//Running code
24 assert(m_atomic->load() != ABORTstate);
25 //If you have got here the ptr was not set so creation is being aborted
26 //The hash is being set to the aborted flag
27 //I think memory ordering can be relaxed here but to be safe we will use defaults.
28 m_atomic->compare_exchange_strong(waitstate, ABORTstate);
29 //Notify_all to wake up any threads waiting for this hash
30 m_atomic->notify_all();
31
32 m_atomic = nullptr;
33}
34
35//Can't imagine why this would be used but this may be necessary
37 m_atomic = nullptr;
38}
39
std::atomic< const void * > * m_atomic