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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-06-24 18:43:08 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-06-24 21:35:17 +0400
commit04648767fabda7d9461e32c89afcd806d0227547 (patch)
treee7297fca0b6d623892b9a08aea9bbb0b4bb025b0 /source/blender/blenkernel/BKE_main.h
parentfc1040cc47594e2a68d120cf08c0c3c70fbc44d1 (diff)
Make main library safe(er) for the threaded usage
Added a lock to the Main which is getting acquired and released when modifying it's lists. Should not be any functional changes now, it just means Main is now considered safe without worrying about locks in the callee.
Diffstat (limited to 'source/blender/blenkernel/BKE_main.h')
-rw-r--r--source/blender/blenkernel/BKE_main.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 721866daff5..ade5733fa4f 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -41,6 +41,7 @@
*
*/
#include "DNA_listBase.h"
+#include "BLI_threads.h"
#ifdef __cplusplus
extern "C" {
@@ -96,6 +97,8 @@ typedef struct Main {
/* Evaluation context used by viewport */
struct EvaluationContext *eval_ctx;
+
+ SpinLock lock;
} Main;
#define MAIN_VERSION_ATLEAST(main, ver, subver) \