From 0986992dbd0d85363f86079a7390632df9cb9d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 9 Aug 2021 11:31:14 +0200 Subject: Cleanup: document `FileListReadJob::tmp_filelist` Add a comment to document what `FileListReadJob::tmp_filelist` is for, and how it's freed. No functional changes. --- source/blender/editors/space_file/filelist.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 4eb58642bba..fae28269349 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -3354,7 +3354,14 @@ typedef struct FileListReadJob { char main_name[FILE_MAX]; Main *current_main; struct FileList *filelist; - /** XXX We may use a simpler struct here... just a linked list and root path? */ + + /** Shallow copy of #filelist for thread-safe access. + * + * The job system calls #filelist_readjob_update which moves any read file from #tmp_filelist + * into #filelist in a thread-safe way. + * + * NOTE: #tmp_filelist is freed in #filelist_readjob_free, so any copied pointers need to be set + * to NULL to avoid double-freeing them. */ struct FileList *tmp_filelist; } FileListReadJob; -- cgit v1.2.3