From 75dd562a0a2002f3b5664754a946a3ac8ffb33cd Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sun, 8 Sep 2024 22:23:03 +0200 Subject: [PATCH] fix #4219 - recursive mutex lock --- core/sync/chan/chan.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sync/chan/chan.odin b/core/sync/chan/chan.odin index a3e0bc21f..53a3bff4b 100644 --- a/core/sync/chan/chan.odin +++ b/core/sync/chan/chan.odin @@ -433,7 +433,7 @@ can_recv :: proc "contextless" (c: ^Raw_Chan) -> bool { can_send :: proc "contextless" (c: ^Raw_Chan) -> bool { sync.guard(&c.mutex) if is_buffered(c) { - return len(c) < cap(c) + return c.queue.len < c.queue.cap } return sync.atomic_load(&c.r_waiting) > 0 }