diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-08 22:23:03 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-08 22:23:03 +0200 |
| commit | 75dd562a0a2002f3b5664754a946a3ac8ffb33cd (patch) | |
| tree | 53d4d57d4753bcd10c89e120260f652dfd67244c /core/sync/chan | |
| parent | e72d0ba8042f3b2ebd7d94aa7b4dae676827e952 (diff) | |
fix #4219 - recursive mutex lock
Diffstat (limited to 'core/sync/chan')
| -rw-r--r-- | core/sync/chan/chan.odin | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |