File tree Expand file tree Collapse file tree
include/ipfixprobe/outputPlugin/outputStorage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,10 +133,21 @@ class AllocationBufferS : public AllocationBufferBase<ElementType> {
133133
134134 void clearStealRequest (const uint8_t victimIndex) noexcept
135135 {
136- HelpState currentValue = m_helpStates[victimIndex]->load (std::memory_order_acquire);
137- currentValue.stealingRequested = false ;
138- m_helpStates[victimIndex]->store (currentValue, std::memory_order_release);
136+ HelpState expected;
137+ HelpState desired;
138+ do {
139+ expected = m_helpStates[victimIndex]->load (std::memory_order_acquire);
140+ desired = expected;
141+ desired.stealingRequested = false ;
142+ } while (!m_helpStates[victimIndex]->compare_exchange_weak (
143+ expected,
144+ desired,
145+ std::memory_order_release,
146+ std::memory_order_acquire));
139147 }
148+ /* = m_helpStates[victimIndex]->load(std::memory_order_acquire);
149+ currentValue.stealingRequested = false;
150+ m_helpStates[victimIndex]->store(currentValue, std::memory_order_release);*/
140151
141152 struct WriterData {
142153 explicit WriterData (ElementType* begin, const std::size_t size) noexcept
You can’t perform that action at this time.
0 commit comments