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

mutexUnlock

Public Function
std.Io.Threaded.mutexUnlock
pub fn mutexUnlock(m: *Io.Mutex) void

Same as Io.Mutex.unlock but avoids the VTable.

Params

  • m: *Io.Mutex

File

Io/Threaded.zig:19095
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
pub fn mutexUnlock(m: *Io.Mutex) void {
    switch (m.state.swap(.unlocked, .release)) {
        .unlocked => unreachable,
        .locked_once => {},
        .contended => {
            @branchHint(.unlikely);
            Thread.futexWake(@ptrCast(&m.state.raw), 1);
        },
    }
}