1
0
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:
Bartosz Taudul
2018-08-20 22:35:50 +02:00
parent 8c0ff67796
commit facb05f8cb
2 changed files with 17 additions and 3 deletions
+11
View File
@@ -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;