[Bf-blender-cvs] [003b568] master: Point density: Workaround for possible race condition

Sergey Sharybin noreply at git.blender.org
Sat Jul 18 23:00:50 CEST 2015


Commit: 003b56801c1449ecc596c2b904fa75faecb7dfea
Author: Sergey Sharybin
Date:   Sat Jul 18 22:57:02 2015 +0200
Branches: master
https://developer.blender.org/rB003b56801c1449ecc596c2b904fa75faecb7dfea

Point density: Workaround for possible race condition

There was possible race condition in the point density sampling caused
by access to the same data in particle system from sampling thread and
sampling initialization.

Could have happened when two different point density textures were using
same particle system

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

M	source/blender/render/intern/source/pointdensity.c

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

diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index d2ec5d8..165a1bb 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -687,8 +687,6 @@ void RE_sample_point_density(Scene *scene, PointDensity *pd,
 
 	BLI_mutex_lock(&sample_mutex);
 	cache_pointdensity_ex(scene, pd, mat, mat, 1, 1);
-	BLI_mutex_unlock(&sample_mutex);
-
 	for (z = 0; z < resolution; ++z) {
 		for (y = 0; y < resolution; ++y) {
 			for (x = 0; x < resolution; ++x) {
@@ -711,4 +709,5 @@ void RE_sample_point_density(Scene *scene, PointDensity *pd,
 		}
 	}
 	free_pointdensity(pd);
+	BLI_mutex_unlock(&sample_mutex);
 }




More information about the Bf-blender-cvs mailing list