From 3763477554f210442f2aa7bdace2cf1f10f13b3a Mon Sep 17 00:00:00 2001 From: jakka Date: Thu, 17 Jul 2025 12:54:09 +0300 Subject: waiting for threads to finish work --- src/files.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/files.rs b/src/files.rs index 8db0f64..8181d1b 100644 --- a/src/files.rs +++ b/src/files.rs @@ -186,8 +186,10 @@ pub fn reencode_files(conn: Connection, handler: Arc, threads: usize }); } - while *thread_counter.read().unwrap() != 0 { - sleep(time::Duration::from_millis(100)); + loop { + if *thread_counter.read().unwrap() == 0 { + break; + } } #[cfg(not(test))] -- cgit v1.3.1