Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-06-11 11:23:52 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-06-11 15:53:15 +0300
commita6803bf56429829e6da5bd9702508190b27df711 (patch)
tree0a93f13cb5c0d64c6d139703e05373e1152e4808 /source/blender/compositor/intern
parentbb5e46f10506f6fcfdf5777af3f0039bab49ed3c (diff)
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.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 39ffa42e03c..a7f45ffdf81 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -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];