From 003b56801c1449ecc596c2b904fa75faecb7dfea Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 18 Jul 2015 22:57:02 +0200 Subject: [PATCH] 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 --- source/blender/render/intern/source/pointdensity.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index d2ec5d80c91..165a1bbb687 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); }