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>2019-06-06 11:39:44 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-06 11:39:44 +0300
commit0f26332d5d9a5cb6363afb3416a1bebd0d936230 (patch)
treef25e4a18ab2c4d32e4828a100491d17f7a835630
parent2819b609339b907421dc25c00223950ccee381ab (diff)
Remove mutex lock from node localization
There is no obvious threading-unsafe code in the localization. The main source of issues were the new_node/new_socket pointers which are no longer used during node tree duplication.
-rw-r--r--source/blender/blenkernel/intern/node.c18
-rw-r--r--source/blender/blenloader/intern/readfile.c1
-rw-r--r--source/blender/makesdna/DNA_node_types.h3
3 files changed, 0 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 6ff0bb96004..e1f7a346b1c 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -322,7 +322,6 @@ void ntreeSetTypes(const struct bContext *C, bNodeTree *ntree)
static GHash *nodetreetypes_hash = NULL;
static GHash *nodetypes_hash = NULL;
static GHash *nodesockettypes_hash = NULL;
-static SpinLock spin;
bNodeTreeType *ntreeTypeFind(const char *idname)
{
@@ -1426,8 +1425,6 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain),
/* in case a running nodetree is copied */
ntree_dst->execdata = NULL;
- ntree_dst->duplilock = NULL;
-
BLI_listbase_clear(&ntree_dst->nodes);
BLI_listbase_clear(&ntree_dst->links);
@@ -2046,10 +2043,6 @@ void ntreeFreeTree(bNodeTree *ntree)
BKE_node_instance_hash_free(ntree->previews, (bNodeInstanceValueFP)BKE_node_preview_free);
}
- if (ntree->duplilock) {
- BLI_mutex_free(ntree->duplilock);
- }
-
if (ntree->id.tag & LIB_TAG_LOCALIZED) {
BKE_libblock_free_data(&ntree->id, true);
}
@@ -2227,14 +2220,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
bNodeTree *ltree;
bNode *node;
- BLI_spin_lock(&spin);
- if (!ntree->duplilock) {
- ntree->duplilock = BLI_mutex_alloc();
- }
- BLI_spin_unlock(&spin);
-
- BLI_mutex_lock(ntree->duplilock);
-
/* Make full copy outside of Main database.
* Note: previews are not copied here.
*/
@@ -2264,8 +2249,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
ntree->typeinfo->localize(ltree, ntree);
}
- BLI_mutex_unlock(ntree->duplilock);
-
return ltree;
}
else {
@@ -3978,7 +3961,6 @@ void init_nodesystem(void)
nodetreetypes_hash = BLI_ghash_str_new("nodetreetypes_hash gh");
nodetypes_hash = BLI_ghash_str_new("nodetypes_hash gh");
nodesockettypes_hash = BLI_ghash_str_new("nodesockettypes_hash gh");
- BLI_spin_init(&spin);
register_undefined_types();
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a4bdf02c838..6ea61980fd0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3482,7 +3482,6 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
ntree->progress = NULL;
ntree->execdata = NULL;
- ntree->duplilock = NULL;
ntree->adt = newdataadr(fd, ntree->adt);
direct_link_animdata(fd, ntree->adt);
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 342641f00ac..672dbaebae1 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -479,9 +479,6 @@ typedef struct bNodeTree {
int (*test_break)(void *);
void (*update_draw)(void *);
void *tbh, *prh, *sdh, *udh;
-
- void *duplilock;
-
} bNodeTree;
/* ntree->type, index */