diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-09 14:18:01 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-10 14:52:20 -0400 |
| commit | 73f5ab473c4129ae209838d7967286684ac3f462 (patch) | |
| tree | 33ca54d9b5899f8823f0935cf79b7270671f2c41 /core/sync | |
| parent | 0a594147afbfdacece1d221d2dee744e612362c6 (diff) | |
Keep `chan.can_recv` from deadlocking
Diffstat (limited to 'core/sync')
| -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 53a3bff4b..aca08d82e 100644 --- a/core/sync/chan/chan.odin +++ b/core/sync/chan/chan.odin @@ -423,7 +423,7 @@ raw_queue_pop :: proc "contextless" (q: ^Raw_Queue) -> (data: rawptr) { can_recv :: proc "contextless" (c: ^Raw_Chan) -> bool { sync.guard(&c.mutex) if is_buffered(c) { - return len(c) > 0 + return c.queue.len > 0 } return sync.atomic_load(&c.w_waiting) > 0 } |