Allow just freeing blocks.

This commit is contained in:
Bartosz Taudul
2020-01-03 00:37:40 +01:00
parent 8588b8b4a6
commit 89254ab353
+14
View File
@@ -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();