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 library itself.

checkCancel

This function acts as a pure cancelation point (subject to protection; see CancelProtection) and does nothing else. In other words, it returns error.Canceled if there is an outstanding non-blocked cancelation request, but otherwise is a no-op.

It is rarely necessary to call this function. The primary use case is in long-running CPU-bound tasks which may need to respond to cancelation before completing. Short tasks, or those which perform other Io operations (and hence have other cancelation points), will typically already respond quickly to cancelation requests.

For a description of cancelation and cancelation points, see Future.cancel.

Io.checkCancel
pub fn checkCancel(io: Io) Cancelable!void

File

lib/std/Io.zig:1382

Code

pub fn checkCancel(io: Io) Cancelable!void {
    return io.vtable.checkCancel(io.userdata);
}