2
0
mirror of https://github.com/wolfpld/tracy synced 2026-01-19 17:02:11 +00:00
Files
tracy/client/TracyLfq.cpp
2020-01-06 17:40:57 +01:00

21 lines
483 B
C++

#include "TracyLfq.hpp"
namespace tracy
{
LfqBlock* LfqProducerImpl::NextBlock()
{
LfqBlock* blk = m_queue->GetFreeBlock();
assert( blk );
assert( blk->next.load( std::memory_order_relaxed ) == nullptr );
blk->thread = m_thread;
lfq.dataEnd = blk->dataEnd;
lfq.tail = &blk->tail;
LfqBlock* oldBlk = m_block.load( std::memory_order_relaxed );
m_block.store( blk, std::memory_order_release );
m_queue->ReleaseBlock( oldBlk );
return blk;
}
}