diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-24 18:43:08 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-24 21:35:17 +0400 |
commit | 04648767fabda7d9461e32c89afcd806d0227547 (patch) | |
tree | e7297fca0b6d623892b9a08aea9bbb0b4bb025b0 /source/blender/blenkernel/intern/material.c | |
parent | fc1040cc47594e2a68d120cf08c0c3c70fbc44d1 (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/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index de3aea9267f..4f6f234c6e1 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -780,11 +780,13 @@ void test_object_materials(Main *bmain, ID *id) return; } + BLI_spin_lock(&bmain->lock); for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->data == id) { BKE_material_resize_object(ob, *totcol, false); } } + BLI_spin_unlock(&bmain->lock); } void assign_material_id(ID *id, Material *ma, short act) |