chan
chan copied to clipboard
Will select block if chan_can_recv first true then false?
https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L407
https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L444
In the implementation of chan_select
, it first checks every channel to see if it can recv/send. After that it randomly select one and do the recv/send.
What about if a channel can recv/send while checking but cannnot when really do it.
It seems the chan_select will block.