Thread-safe async/await lock. Functions which are waiting for the lock are suspended, and are resumed when the lock is released, in order. Many readers can hold the lock at the same time; however locking for writing is exclusive. When a read lock is held, it will not be released until the reader queue is empty. When a write lock is held, it will not be released until the writer queue is empty. TODO: make this API also work in blocking I/O mode

Fields

shared_state: State,
writer_queue: Queue,
reader_queue: Queue,
writer_queue_empty: bool,
reader_queue_empty: bool,
reader_lock_count: usize,

Functions

fn acquireRead(self: *RwLock) callconv(.Async) HeldRead

No documentation provided.

fn acquireWrite(self: *RwLock) callconv(.Async) HeldWrite

No documentation provided.

fn deinit(self: *RwLock) void

Must be called when not locked. Not thread safe. All calls to acquire() and rel…

Must be called when not locked. Not thread safe. All calls to acquire() and release() must complete before calling deinit().

fn init() RwLock

No documentation provided.