mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Don't mark FastVector element as used until it's ready.
This should prevent a race condition that would result in invalid last element of the queue, in case a freezed thread already got the queue item, but didn't wrote to it (or didn't wrote fully).
This commit is contained in:
@@ -60,6 +60,17 @@ public:
|
||||
return m_write++;
|
||||
}
|
||||
|
||||
T* prepare_next()
|
||||
{
|
||||
if( m_write == m_end ) AllocMore();
|
||||
return m_write;
|
||||
}
|
||||
|
||||
void commit_next()
|
||||
{
|
||||
m_write++;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_write = m_ptr;
|
||||
|
||||
Reference in New Issue
Block a user