mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-04 12:04:41 +00:00
Forbid chan.try_send on closed buffered channels
This commit is contained in:
@@ -260,6 +260,10 @@ try_send_raw :: proc "contextless" (c: ^Raw_Chan, msg_in: rawptr) -> (ok: bool)
|
||||
return false
|
||||
}
|
||||
|
||||
if sync.atomic_load(&c.closed) {
|
||||
return false
|
||||
}
|
||||
|
||||
ok = raw_queue_push(c.queue, msg_in)
|
||||
if sync.atomic_load(&c.r_waiting) > 0 {
|
||||
sync.signal(&c.r_cond)
|
||||
|
||||
Reference in New Issue
Block a user