17 m_mask(cache->fullSize(), false), m_waitNeeded(false) {}
20 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
27 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
33 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
34 return m_map.cbegin();
38 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
40 if(itr!= m_map.end() && itr->first==hashId)
return itr;
46 std::scoped_lock lock (m_waitMutex);
47 if(m_waitNeeded.load(std::memory_order_acquire) ==
false)
return;
50 while(!m_waitlist.empty()) {
51 IdentifierHash
hash = m_waitlist.back();
53 const void*
ptr = cacheLink->waitFor(
hash);
54 if(
ptr == ABORTstate) {
57 m_waitlist.pop_back();
60 for(
size_t i =0;
i<m_mask.size();
i++){
63 m_waitNeeded.store(
false, std::memory_order_release);
69 if(!m_waitlist.empty()) m_waitNeeded.store(
true, std::memory_order_relaxed);
72 m_mask[hashId] =
true;
73 m_waitNeeded.store(
true, std::memory_order_relaxed);
86 m_mask[hashId] =
true;
87 m_waitNeeded.store(
true, std::memory_order_relaxed);
92 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
93 std::vector<IdentifierHash>
ids;
94 ids.reserve(m_map.size());
95 for(
auto &
x : m_map) {
96 ids.emplace_back(
x.first);
102 if(m_waitNeeded.load(std::memory_order_acquire))
wait();
107 if(m_waitNeeded.load(std::memory_order_relaxed))
wait();
110 m_waitNeeded.store(
true, std::memory_order_relaxed);
116 if(
ptr) { m_mask[hashId] =
true; m_waitNeeded.store(
true, std::memory_order_relaxed); }
117 return StatusCode::SUCCESS;
121 throw std::runtime_error(
"Not implemented");
130 m_mask[hashId] =
true;
131 m_waitNeeded.store(
true, std::memory_order_relaxed);
132 return ptr == cacheinserted.second;
136 if(hashId < m_mask.size() and m_mask[hashId]) {
146 throw std::runtime_error(
"IDC WARNING Deletion shouldn't occur in addLock paradigm");
148 m_mask[hashId] =
true;
149 m_waitNeeded.store(
true, std::memory_order_relaxed);
150 return StatusCode::SUCCESS;
154 throw std::runtime_error(
"Do not remove things from an online IDC");