Blender Git Loki

Git Commits -> Revision 4617172

Revision 4617172 by Julian Eisel (master)
July 1, 2021, 13:22 (GMT)
Fix race condition when loading multiple File/Asset Browsers at once

When multiple File or Asset Browsers would load at once (e.g. when loading a
file with two File Browsers open) and they would load multiple directories or
.blend files (using the Recursions option in the File Browser or loading an
asset library with multiple .blends), often only one File/Asset Browser would
correctly load all files. Others would be incomplete or entirely empty. That
was because of a race condition, where the directories or .blend files would be
loaded concurrently and the first one that finished would cancel the other
ones. This again happened because they used the job system with the same
"owner", which by design makes all jobs with the same owner cancel as soon as
the first is finished.
Address this by making sure they have different owners. That is, not the scene
anymore, but the filelist the job belongs to. Doesn't make much sense to use
the scene as owner for scene-unrelated file loading anyway.

Steps to reproduce were:
* Open two File Browsers as regular editors.
* In the Display Settings popover, set "Recursions" to 2 or 3 levels.
* Navigate to a directory with plenty of subdirectories in both File Browsers.
* Save the file.
* Reload the file, one of the File Browsers likely has an incomplete file list.

Alternatively, use Asset Browsers and open an asset library containing multiple
.blends.

Commit Details:

Full Hash: 461717274091113112416d2733d4b44eacb57017
Parent Commit: a112adf
Lines Changed: +25, -33

8 Modified Paths:

/source/blender/editors/include/ED_fileselect.h (+3, -7) (Diff)
/source/blender/editors/space_file/filelist.c (+5, -5) (Diff)
/source/blender/editors/space_file/filelist.h (+2, -2) (Diff)
/source/blender/editors/space_file/filesel.c (+7, -11) (Diff)
/source/blender/editors/space_file/file_draw.c (+1, -1) (Diff)
/source/blender/editors/space_file/file_ops.c (+4, -4) (Diff)
/source/blender/editors/space_file/space_file.c (+2, -2) (Diff)
/source/blender/makesrna/intern/rna_space.c (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021