pub fn tryLock(rl: *RwLock, io: Io) bool
pub fn tryLock(rl: *RwLock, io: Io) bool { if (rl.mutex.tryLock()) { const state = @atomicLoad(usize, &rl.state, .seq_cst); if (state & reader_mask == 0) { _ = @atomicRmw(usize, &rl.state, .Or, is_writing, .seq_cst); return true; } rl.mutex.unlock(io); } return false; }