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 @@ -69,6 +69,7 @@ class FFQ2OutputStorage : public FFQOutputStorage<ElementType> {
6969 while (!this ->m_cells [readIndex].state .tryToSetReadingStarted ()) {
7070 backoffScheme.backoff ();
7171 }
72+
7273 // std::atomic_thread_fence(std::memory_order_acquire);
7374 this ->m_readersData [readerIndex]->lastReadIndex = readIndex;
7475 /* if (this->m_storage[readIndex].empty()) {
Original file line number Diff line number Diff line change @@ -160,8 +160,8 @@ class FFQOutputStorage : public OutputStorage<ElementType> {
160160
161161 // std::atomic<uint64_t> m_startedState;
162162 // std::atomic<uint64_t> m_finishedState;
163- std::atomic<bool > m_readingStarted {false };
164- std::atomic<bool > m_readingFinished {false };
163+ std::atomic<bool > m_readingStarted {true };
164+ std::atomic<bool > m_readingFinished {true };
165165 std::atomic<bool > m_writingStarted {false };
166166 };
167167
@@ -174,7 +174,7 @@ class FFQOutputStorage : public OutputStorage<ElementType> {
174174 };
175175
176176 struct ReaderData {
177- std::optional<uint16_t > lastReadIndex {0 };
177+ std::optional<uint16_t > lastReadIndex {};
178178 };
179179
180180 std::array<CacheAlligned<ReaderData>, OutputStorage<ElementType>::MAX_READERS_COUNT>
Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ class OutputStorage {
7070 m_writersCount--;
7171 }
7272
73- bool writersPresent () const noexcept { return m_writersCount > 0 ; }
73+ bool writersPresent () const noexcept
74+ {
75+ return m_writersCount.load (std::memory_order_acquire) > 0 ;
76+ }
7477
7578 virtual bool finished () noexcept = 0;
7679
You can’t perform that action at this time.
0 commit comments