std1.0.0-beta-7 SafeC docs

std :: thread

Struct std::RwLock

#include <std/thread.h> source

generic<T: Send + Sync> struct RwLock { }

Like Mutex<T>, with many readers at once (const access) or one writer. Readers share the value, so T must be Sync as well as Send.

Methods

§static struct RwLock<T> new(T value)source · definition
§struct RwReadGuard<T> read() constsource · definition

shared: get() is const

§struct RwWriteGuard<T> write() constsource · definition

exclusive

§void drop()source · definition