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 Struct

WasiThread

Private Struct
std.Thread.WasiThreadImpl.WasiThread
const WasiThread = struct

Fields

tid: std.atomic.Value(i32) = std.atomic.Value(i32).init(0)

Thread ID

memory: []u8

Contains all memory which was allocated to bootstrap this thread, including:

  • Guard page
  • Stack
  • TLS segment
  • Instance All memory is freed upon call to join
allocator: std.mem.Allocator

The allocator used to allocate the thread's memory, which is also used during join to ensure clean-up.

state: State = State.init(.running)

The current state of the thread.

File

Thread.zig:815
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
    const WasiThread = struct {
        /// Thread ID
        tid: std.atomic.Value(i32) = std.atomic.Value(i32).init(0),
        /// Contains all memory which was allocated to bootstrap this thread, including:
        /// - Guard page
        /// - Stack
        /// - TLS segment
        /// - `Instance`
        /// All memory is freed upon call to `join`
        memory: []u8,
        /// The allocator used to allocate the thread's memory,
        /// which is also used during `join` to ensure clean-up.
        allocator: std.mem.Allocator,
        /// The current state of the thread.
        state: State = State.init(.running),
    }