fn tryLock(mutex: *Mutex) bool
mutex: *Mutex
929 930 931 932 933 934 935 936
fn tryLock(mutex: *Mutex) bool { const state = @atomicRmw(State, &mutex.state, .Or, .{ .locked = true, .num_waiters = 0 }, .acquire); if (state.locked) { @branchHint(.unlikely); } return !state.locked; }