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 › AsyncClosure › call Private Function call Doc Source Private Function std.Io.Dispatch.AsyncClosure.call
fn call (
closure : *AsyncClosure ,
message : *const SwitchMessage ,
) callconv (.withStackAlign (.c , @alignOf (AsyncClosure ))) noreturn Params File Io/Dispatch.zig: 1019
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031 fn call (
closure : *AsyncClosure ,
message : *const SwitchMessage ,
) callconv (.withStackAlign (.c , @alignOf (AsyncClosure ))) noreturn {
const ev = closure .evented ;
const fiber = closure .fiber ;
message .handle (ev );
closure .start (closure .contextPointer (), fiber .resultBytes (closure .result_align ));
if (@atomicRmw (?*Fiber , &fiber .link .awaiter , .Xchg , Fiber .finished , .acq_rel )) |awaiter |
ev .queue .async (awaiter , &Fiber .@"resume" );
ev .yield (.nothing );
unreachable ; // switched to dead fiber
}