Replace Main->lock with an anoynous structure pointer

This way it's not needed to include BLI_threads.h from the
BKE_main.h which helps avoiding adding PThreads includes to
each library which uses Main on Windows.

From the API point of view it's now MainLock* and to lock or
unlock the main you're to use BKE_main_(un)lock().

This solves compilation error on Windows with SCons.
This commit is contained in:
2014-06-26 14:55:40 +06:00
parent 33e8451d4b
commit 6135556f45
4 changed files with 26 additions and 10 deletions

View File

@@ -780,13 +780,13 @@ void test_object_materials(Main *bmain, ID *id)
return;
}
BLI_spin_lock(&bmain->lock);
BKE_main_lock(bmain);
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);
BKE_main_unlock(bmain);
}
void assign_material_id(ID *id, Material *ma, short act)