diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-11-08 19:54:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-11-08 19:54:14 +0300 |
commit | 4d0f7c320c29bcb5dcf4435a0740822d00d35493 (patch) | |
tree | cccef40649907d20650d917523b1de78ff2d6816 /source/blender/blenkernel/intern/library.c | |
parent | 682bcb29956c0699e54b7b9200f048b30bebc4d0 (diff) |
Depsgraph: Use atomics to tag ID when evaluating driver
This is required since new dependency graph evaluates drivers in threads
so it was possible to have some partially written ID tag there.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 5d28a84ef18..5d23788f6f7 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -129,6 +129,8 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "atomic_ops.h" + /* GS reads the memory pointed at in a specific ordering. * only use this definition, makes little and big endian systems * work fine, in conjunction with MAKE_ID */ @@ -1895,3 +1897,13 @@ void BKE_library_filepath_set(Library *lib, const char *filepath) BLI_path_abs(lib->filepath, basepath); } } + +void BKE_id_tag_set_atomic(ID *id, int tag) +{ + atomic_fetch_and_or_uint32((uint32_t *)&id->tag, tag); +} + +void BKE_id_tag_clear_atomic(ID *id, int tag) +{ + atomic_fetch_and_and_uint32((uint32_t *)&id->tag, ~tag); +} |