Merge pull request #2969 from cgwalters/fix-sync-pthreads

deploy: Fix mutex locking for global sync timeout
This commit is contained in:
Joseph Marrero Corchado 2023-08-04 11:34:13 -04:00 committed by GitHub
commit 7f70614a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1606,11 +1606,10 @@ static void *
sync_in_thread (void *ptr)
{
SyncData *syncdata = ptr;
// Ensure that the caller is blocked waiting
g_mutex_lock (&syncdata->mutex);
ot_journal_print (LOG_INFO, "Starting global sync()");
sync ();
ot_journal_print (LOG_INFO, "Completed global sync()");
g_mutex_lock (&syncdata->mutex);
// Signal success
syncdata->success = true;
g_cond_broadcast (&syncdata->cond);