fix compiler error

This commit is contained in:
Daniella 2022-10-11 06:40:44 +02:00
parent 5ba44d216f
commit 9402193e1f

View file

@ -379,6 +379,7 @@ async fn main() {
let running = Arc::new(Mutex::new(0)); let running = Arc::new(Mutex::new(0));
println!("encode: encoding gifs..."); println!("encode: encoding gifs...");
for n in 0..((dir as f32 / (25.0 * 5.0)).ceil() as usize) { for n in 0..((dir as f32 / (25.0 * 5.0)).ceil() as usize) {
{
let running = running.clone(); let running = running.clone();
thread::spawn(move || { thread::spawn(move || {
*running.lock().unwrap() += 1; *running.lock().unwrap() += 1;
@ -433,6 +434,7 @@ async fn main() {
*running.lock().unwrap() -= 1; *running.lock().unwrap() -= 1;
println!("encode: encoded {n}"); println!("encode: encoded {n}");
}); });
}
while *running.lock().unwrap() < 5 { while *running.lock().unwrap() < 5 {
tokio::time::sleep(Duration::from_millis(100)).await; tokio::time::sleep(Duration::from_millis(100)).await;
} }