[Bf-blender-cvs] [8bc8713beb8] master: Cleanup: avoid (harmless) race condition reported by Helgrind

Johan Walles noreply at git.blender.org
Mon Mar 9 17:12:09 CET 2020


Commit: 8bc8713beb8220cdac1475a2f8f99fda8c888b32
Author: Johan Walles
Date:   Mon Mar 9 16:52:34 2020 +0100
Branches: master
https://developer.blender.org/rB8bc8713beb8220cdac1475a2f8f99fda8c888b32

Cleanup: avoid (harmless) race condition reported by Helgrind

Differential Revision: https://developer.blender.org/D7058

===================================================================

M	intern/cycles/util/util_progress.h

===================================================================

diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h
index 379beaeeefa..23e49b4db7a 100644
--- a/intern/cycles/util/util_progress.h
+++ b/intern/cycles/util/util_progress.h
@@ -204,6 +204,8 @@ class Progress {
 
   float get_progress()
   {
+    thread_scoped_lock lock(progress_mutex);
+
     if (total_pixel_samples > 0) {
       return ((float)pixel_samples) / total_pixel_samples;
     }



More information about the Bf-blender-cvs mailing list