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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-08-18 13:35:43 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-08-18 13:39:45 +0300
commitd85e94da07d3d8bb213ef2e3d98c2032edad7155 (patch)
treee4a9993274bc4306170a86fe8f2c7b657de76e07 /source/blender/imbuf/IMB_thumbs.h
parent81afa2953cab20a59f1997aaf12dc85f5acbea0b (diff)
IMB_thumb: add thread locking API.
General idea is that, if several threads are handling thumbnails at the same time, they can end working on the same file at some point, which will generate conflict. To avoid this, threads can now lock a given filepath. Note that locking data is allocated on a ref-count basis, to avoid keeping the GSet in memory when not needed. Also, we are using global LOCK_IMAGE mutex for now. Needed for upcomming filebrowser rework.
Diffstat (limited to 'source/blender/imbuf/IMB_thumbs.h')
-rw-r--r--source/blender/imbuf/IMB_thumbs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index f2f75973bcd..13237fe26a1 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -91,6 +91,12 @@ void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float
ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y);
bool IMB_thumb_load_font_get_hash(char *r_hash);
+/* Threading */
+void IMB_thumb_locks_acquire(void);
+void IMB_thumb_locks_release(void);
+void IMB_thumb_path_lock(const char *path);
+void IMB_thumb_path_unlock(const char *path);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */