From dbeec2be86db5b4ba440175e59c52ff84eb98462 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Apr 2013 17:31:09 +0000 Subject: Fix #34783: smoke simulation crash when changing frame while preview rendering. Added a mutex lock for smoke data access. The render was already working with a copy of the volume data, so it's just a short lock to copy things and should not block the UI much. --- source/blender/blenlib/BLI_threads.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/BLI_threads.h') diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index ec8e567c0ef..614cd4ee59d 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -92,9 +92,13 @@ typedef pthread_mutex_t ThreadMutex; #define BLI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER void BLI_mutex_init(ThreadMutex *mutex); +void BLI_mutex_end(ThreadMutex *mutex); + +ThreadMutex *BLI_mutex_alloc(void); +void BLI_mutex_free(ThreadMutex *mutex); + void BLI_mutex_lock(ThreadMutex *mutex); void BLI_mutex_unlock(ThreadMutex *mutex); -void BLI_mutex_end(ThreadMutex *mutex); /* Spin Lock */ @@ -117,9 +121,13 @@ void BLI_spin_end(SpinLock *spin); typedef pthread_rwlock_t ThreadRWMutex; void BLI_rw_mutex_init(ThreadRWMutex *mutex); +void BLI_rw_mutex_end(ThreadRWMutex *mutex); + +ThreadRWMutex *BLI_rw_mutex_alloc(void); +void BLI_rw_mutex_free(ThreadRWMutex *mutex); + void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode); void BLI_rw_mutex_unlock(ThreadRWMutex *mutex); -void BLI_rw_mutex_end(ThreadRWMutex *mutex); /* ThreadedWorker * -- cgit v1.2.3