From 7c863d10d1584d8bdab6abad9101a252cdf2703d Mon Sep 17 00:00:00 2001 From: Yuyi-Oak <1722157266@qq.com> Date: Mon, 3 Aug 2026 00:57:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A8=B3=E5=AE=9A=E5=B9=B6=E5=8F=91=20w?= =?UTF-8?q?orker=20=E5=9B=9E=E5=BD=92=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infrastructure/src/downloader.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infrastructure/src/downloader.rs b/infrastructure/src/downloader.rs index 09eeb9c..2fb1935 100644 --- a/infrastructure/src/downloader.rs +++ b/infrastructure/src/downloader.rs @@ -221,6 +221,11 @@ mod tests { thread::sleep(Duration::from_millis(20)); self.active.fetch_sub(1, Ordering::SeqCst); } else { + if task == 1 { + while self.active.load(Ordering::SeqCst) == 0 { + thread::yield_now(); + } + } if task == 2 && self.active.load(Ordering::SeqCst) > 0 { self.task_two_started_while_task_zero_active .fetch_add(1, Ordering::SeqCst);