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

set

Public Function
std.Io.Event.set
pub fn set(e: *Event, io: Io) void

Sets the logical boolean to true, and hence unblocks any pending calls to wait. The logical boolean remains true until reset is called, so future calls to set have no semantic effect.

Any memory accesses prior to a set call are "released", so that if this set call causes isSet to return true or a wait to finish, those tasks will be able to observe those memory accesses.

Params

File

Io.zig:2049
2049
2050
2051
2052
2053
2054
    pub fn set(e: *Event, io: Io) void {
        switch (@atomicRmw(Event, e, .Xchg, .is_set, .release)) {
            .unset, .is_set => {},
            .waiting => io.futexWake(Event, e, math.maxInt(u32)),
        }
    }