From 03f4204297773dd23934a87960252176aa3e2427 Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:22:20 -0700 Subject: [PATCH] Check the boundary condition correctly. --- tpu-client/src/quic_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpu-client/src/quic_client.rs b/tpu-client/src/quic_client.rs index d0a8cd1bdb..f11b7f32b7 100644 --- a/tpu-client/src/quic_client.rs +++ b/tpu-client/src/quic_client.rs @@ -51,7 +51,7 @@ impl AsyncTaskSemaphore { fn acquire(&self) -> MutexGuard { let mut count = self.counter.lock().unwrap(); *count += 1; - while *count >= self.permits { + while *count > self.permits { count = self.cond_var.wait(count).unwrap(); } count