deploy: Fix mutex locking for global sync timeout
authorColin Walters <walters@verbum.org>
Fri, 4 Aug 2023 02:49:48 +0000 (22:49 -0400)
committerColin Walters <walters@verbum.org>
Fri, 4 Aug 2023 03:10:06 +0000 (23:10 -0400)
commit402e04280b54c058ad47be99fe6a9326caf2ae00
tree08b728b5e7fed6ec959f36151d0ac8e6ba55e442
parent09160c1a2b553e39e417a64c254f62470ce2dce5
deploy: Fix mutex locking for global sync timeout

The locking here was always too long - by holding the mutex
during the `sync()` call, it means `g_cond_wait_until()` can
never wake up (because its API requires the mutex to be locked).

Confusingly though of course we do still print the "timed out"
message, and I think that tricked us when we were doing testing
here.

We only need to lock the mutex when we're manipulating shared
state, which basically boils down to the `gboolean success`.
src/libostree/ostree-sysroot-deploy.c