From 8f1a0f7e22d8b790b7afe80145bff43c7222228f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kokem=C3=BCller?= Date: Thu, 23 Dec 2021 23:25:23 +0100 Subject: [PATCH] fix deadlock in 'print_progress_bar' --- scanner/scanner-common/scanner-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scanner/scanner-common/scanner-common.c b/scanner/scanner-common/scanner-common.c index 7b02c75..82b59dd 100644 --- a/scanner/scanner-common/scanner-common.c +++ b/scanner/scanner-common/scanner-common.c @@ -325,7 +325,10 @@ print_progress_bar(gpointer arg) *started = 1; g_cond_broadcast(&progress_cond); } - g_cond_wait(&progress_cond, &progress_mutex); + + if (total_frames != elapsed_frames) { + g_cond_wait(&progress_cond, &progress_mutex); + } /* refresh progress bar at max 10 times per second */ gint64 current_time = g_get_monotonic_time();