From 89254ab353aa30316c6da9ff98ca11d03a8e8e64 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 3 Jan 2020 00:37:40 +0100 Subject: [PATCH] Allow just freeing blocks. --- client/TracyLfq.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/TracyLfq.hpp b/client/TracyLfq.hpp index 2b52fc29..e9fde489 100644 --- a/client/TracyLfq.hpp +++ b/client/TracyLfq.hpp @@ -240,6 +240,20 @@ public: } } + void FreeBlocks( LfqBlock* blk ) + { + auto tail = blk; + for(;;) + { + auto next = tail->next.load(); + if( !next ) break; + tail = next; + } + auto head = m_freeBlocks.load(); + tail->next.store( head ); + while( !m_freeBlocks.compare_exchange_weak( head, blk ) ) tail->next.store( head ); + } + LfqProducerImpl* GetIdleProducer() { LfqProducerImpl* prod = m_producers.load();