mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sync.atomic_load(&c.closed) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
ok = raw_queue_push(c.queue, msg_in)
|
ok = raw_queue_push(c.queue, msg_in)
|
||||||
if sync.atomic_load(&c.r_waiting) > 0 {
|
if sync.atomic_load(&c.r_waiting) > 0 {
|
||||||
sync.signal(&c.r_cond)
|
sync.signal(&c.r_cond)
|
||||||
|
|||||||
Reference in New Issue
Block a user