Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Namespace

UnsupportedImpl

Private Namespace
std.Thread.UnsupportedImpl
const UnsupportedImpl = struct

We can't compile error in the Impl switch statement as its eagerly evaluated. So instead, we compile-error on the methods themselves for platforms which don't support threads.

Values

Functions

fn getCurrentId() usize
fn getCpuCount() !usize
fn spawn(config: SpawnConfig, comptime f: anytype, args: anytype) !Impl
fn getHandle(self: Impl) ThreadHandle
fn detach(self: Impl) void
fn join(self: Impl) void
fn unsupported(unused: anytype) noreturn

File

Thread.zig:464
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
const UnsupportedImpl = struct {
    pub const ThreadHandle = void;

    fn getCurrentId() usize {
        return unsupported({});
    }

    fn getCpuCount() !usize {
        return unsupported({});
    }

    fn spawn(config: SpawnConfig, comptime f: anytype, args: anytype) !Impl {
        return unsupported(.{ config, f, args });
    }

    fn getHandle(self: Impl) ThreadHandle {
        return unsupported(self);
    }

    fn detach(self: Impl) void {
        return unsupported(self);
    }

    fn join(self: Impl) void {
        return unsupported(self);
    }

    fn unsupported(unused: anytype) noreturn {
        _ = unused;
        @compileError("Unsupported operating system " ++ @tagName(native_os));
    }
}