Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Dispatch › Cancelable › requested Private Function requested Doc Source Private Function std.Io.Dispatch.Cancelable.requested
fn requested (cancelable : *Cancelable , fiber : *Fiber ) void Params File Io/Dispatch.zig: 770
770
771
772
773
774
775
776
777
778
779
780
781
782 fn requested (cancelable : *Cancelable , fiber : *Fiber ) void {
const function = cancelable .cancel ;
assert (function != is_blocked and function != is_requested );
assert (@atomicLoad (Fiber .CancelStatus , &fiber .cancel_status , .monotonic ) == Fiber .CancelStatus {
.requested = true ,
.awaiting = .fromCancelable (cancelable ),
});
cancelable .cancel = is_requested ;
@atomicStore (Fiber .CancelStatus , &fiber .cancel_status , .{
.requested = true ,
.awaiting = .nothing ,
}, .monotonic );
}