Compositor: Use atomics to update finished tiles progress
Integer is not safe for incremental by multiple threads and if one is unlucky enough that could cause progress re[reports to go totally nuts.
This commit is contained in:
@@ -44,6 +44,8 @@
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "atomic_ops.h"
|
||||
|
||||
ExecutionGroup::ExecutionGroup()
|
||||
{
|
||||
this->m_isOutput = false;
|
||||
@@ -382,7 +384,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
|
||||
if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED)
|
||||
this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED;
|
||||
|
||||
this->m_chunksFinished++;
|
||||
atomic_add_u(&this->m_chunksFinished, 0);
|
||||
if (memoryBuffers) {
|
||||
for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) {
|
||||
MemoryBuffer *buffer = memoryBuffers[index];
|
||||
|
Reference in New Issue
Block a user