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. Public Function

futex2_requeue

Public Function
std.os.linux.futex2_requeue
pub fn futex2_requeue(
    /// The source and destination futexes.  Must be a 2-element array.
    waiters: [*]const futex2_waitone,
    /// Currently unused.
    flags: FUTEX2_FLAGS_REQUEUE,
    /// Maximum number of waiters to wake on the source futex.
    nr_wake: i32,
    /// Maximum number of waiters to transfer to the destination futex.
    nr_requeue: i32,
) usize

Wake and/or requeue waiter(s) from one futex to another. Identical to FUTEX.CMP_REQUEUE, except it is part of the futex2 family of calls.

Requires at least kernel v6.7.

Params

  • waiters: [*]const futex2_waitone

    The source and destination futexes. Must be a 2-element array.

  • flags: FUTEX2_FLAGS_REQUEUE

    Currently unused.

  • nr_wake: i32

    Maximum number of waiters to wake on the source futex.

  • nr_requeue: i32

    Maximum number of waiters to transfer to the destination futex.

File

os/linux.zig:1009
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
pub fn futex2_requeue(
    /// The source and destination futexes.  Must be a 2-element array.
    waiters: [*]const futex2_waitone,
    /// Currently unused.
    flags: FUTEX2_FLAGS_REQUEUE,
    /// Maximum number of waiters to wake on the source futex.
    nr_wake: i32,
    /// Maximum number of waiters to transfer to the destination futex.
    nr_requeue: i32,
) usize {
    return syscall4(
        .futex_requeue,
        @intFromPtr(waiters),
        @as(u32, @bitCast(flags)),
        @as(u32, @bitCast(nr_wake)),
        @as(u32, @bitCast(nr_requeue)),
    );
}