A lock that supports one writer or many readers. This API is for kernel threads, not evented I/O. This API requires being initialized at runtime, and initialization can fail. Once initialized, the core operations cannot fail.

Fields

impl: Impl = .{ },

Functions

fn lock(rwl: *RwLock) void

Blocks until exclusive lock ownership is acquired.

fn lockShared(rwl: *RwLock) void

Blocks until shared lock ownership is acquired.

fn tryLock(rwl: *RwLock) bool

Attempts to obtain exclusive lock ownership. Returns true if the lock is obta…

Attempts to obtain exclusive lock ownership. Returns true if the lock is obtained, false otherwise.

fn tryLockShared(rwl: *RwLock) bool

Attempts to obtain shared lock ownership. Returns true if the lock is obtaine…

Attempts to obtain shared lock ownership. Returns true if the lock is obtained, false otherwise.

fn unlock(rwl: *RwLock) void

Releases a held exclusive lock. Asserts the lock is held exclusively.

fn unlockShared(rwl: *RwLock) void

Releases a held shared lock.

Values

Impl
type