Skip to main content

patch_seq_close_channel

Function patch_seq_close_channel 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_close_channel( stack: Stack, ) -> Stack
Expand description

Close a channel.

Stack effect: ( Channel – )

Atomically marks the channel closed (idempotent across multiple chan.close callers via CAS) and, on the first close, enqueues one ChannelMsg::Closed sentinel. Any blocked chan.receive calls wake up: the first one consumes the sentinel and re-broadcasts it, propagating the close through the MPMC fan-out lazily as each blocked receiver is scheduled.

§Safety

Stack must have a Channel on top.