fix: 稳定并发 worker 回归测试
bat-rust / Build and test Go API (push) Canceled after 0s
bat-rust / Build and test Rust (push) Canceled after 0s

This commit is contained in:
2026-08-03 00:57:29 +08:00
parent 9a5b3ba39b
commit 7c863d10d1
+5
View File
@@ -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);