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

Bucket

Private Struct
std.Io.Threaded.parking_futex.Bucket
const Bucket = struct

Fields

num_waiters: std.atomic.Value(u32)

Used as a fast check for wake to avoid having to acquire mutex to discover there are no waiters. It is important for wait to increment this before checking the futex value to avoid a race.

mutex: ParkingMutex

Protects waiters.

waiters: std.DoublyLinkedList
_: void = {}

Prevent false sharing between buckets.

Values

File

Io/Threaded.zig:17559
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
    const Bucket = struct {
        /// Used as a fast check for `wake` to avoid having to acquire `mutex` to discover there are no
        /// waiters. It is important for `wait` to increment this *before* checking the futex value to
        /// avoid a race.
        num_waiters: std.atomic.Value(u32),
        /// Protects `waiters`.
        mutex: ParkingMutex,
        waiters: std.DoublyLinkedList,

        /// Prevent false sharing between buckets.
        _: void align(std.atomic.cache_line) = {},

        const init: Bucket = .{ .num_waiters = .init(0), .mutex = .init, .waiters = .{} };
    }