Merged requested to merge pwithnall/gnome-software:fedora-third-party-locking into main
This prevents a livelock of the UI thread, because it’s possible for the
UI (main) thread to call
a worker thread is calling
The worker thread may take a long time to run, and currently all the
time it’s running it’s holding the lock in
gs_fedora_third_party_is_available() needs to be able
to take that lock.
This results in freezing the main thread until the worker thread returns.
Fix that by reducing the size of the locked sections, and moving all the subprocess spawning outside the locked sections.
Two main changes are needed to do this:
gs_fedora_third_party_ensure_executable_locked()return a copy of the executable path, so that callers can use that and drop their lock, rather than subsequently referring to
self->executablewith the lock held.
- Split the locked section in
gs_fedora_third_party_list_sync()in two: once to check whether an update of
self->reposis needed, then the subprocess is spawned without the lock held, then the lock is taken again to write the results to the
Signed-off-by: Philip Withnall email@example.com