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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-03-01 23:46:58 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-03-02 00:05:50 +0400
commitf01d19431d0e2a14a007d5480e805b99dc933169 (patch)
tree564d2c303ba3ff3413a8bc413ee133869ac1ba2b /source/blender/blenlib/intern/threads.c
parent3eabe064ab5401b9f0267c0a4a31379541084610 (diff)
Fix T38873: Crashing on undo of ocean modifier.
Issue of this bug is that most part of fftw is not thread safe, only compute-intensive fftw_execute & co are. Since smoke was affected by this issue as well, a global fftw mutex was added to BLI_threads. Audaspace also uses fftw in one of its readers (AUD_BandPassReader.cpp), but this is not an issue currently since this code is disabled in CMake/scons files. There was another threading issue with smoke, we need to copy dm used by emit_from_derivedmesh(), as it is modified by this func. Reviewers: sergey, brecht Reviewed By: brecht CC: brecht Differential Revision: https://developer.blender.org/D374
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r--source/blender/blenlib/intern/threads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index c9f4e9ddc15..ded2fd7e06d 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -121,6 +121,7 @@ static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _nodes_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _movieclip_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _colormanage_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t _fftw_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t mainid;
static int thread_levels = 0; /* threads can be invoked inside threads */
static int num_threads_override = 0;
@@ -399,6 +400,8 @@ void BLI_lock_thread(int type)
pthread_mutex_lock(&_movieclip_lock);
else if (type == LOCK_COLORMANAGE)
pthread_mutex_lock(&_colormanage_lock);
+ else if (type == LOCK_FFTW)
+ pthread_mutex_lock(&_fftw_lock);
}
void BLI_unlock_thread(int type)
@@ -421,6 +424,8 @@ void BLI_unlock_thread(int type)
pthread_mutex_unlock(&_movieclip_lock);
else if (type == LOCK_COLORMANAGE)
pthread_mutex_unlock(&_colormanage_lock);
+ else if (type == LOCK_FFTW)
+ pthread_mutex_unlock(&_fftw_lock);
}
/* Mutex Locks */