Skip to content

ThunarFile cache: improve mutex use

Andrew Chadwick requested to merge achadwick/thunar:file-cache-mutex into master

Addresses something I spotted in #787 (comment 50021). Sadly, it doesn't fix the assertion in #787 (closed) or the apparent file duplication in !255 (merged) :sigh:

You can take it or leave it, in other words. However I do think that this change makes the cache access more correct 😸

Remove an unneeded additional hash table insert in thunar_file_get(), and add some defensive programming to ensure that the side effect we now rely on remains the case.

Contingent cache lookup and insert pairs now happen in the same mutex-locked critical section. Added unguarded versions of a couple of already static funcs, for internal use only but more so.

Merge request reports

Loading