Browse Source

fix #4219 - recursive mutex lock

Laytan Laats 11 months ago
parent
commit
75dd562a0a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/sync/chan/chan.odin

+ 1 - 1
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
 }