const Bucket = struct 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: ParkingMutexProtects waiters.
waiters: std.DoublyLinkedList_: void = {}Prevent false sharing between buckets.
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 = .{} };
}