std1.0.0-beta-7 SafeC docs

std :: thread

Struct std::MutexGuard

#include <std/thread.h> source

generic<T> struct MutexGuard { }

Proof of holding a Mutex's lock: get() is the protected value, valid until the guard is dropped (which unlocks).

Methods

§&T get()source · definition

the value: don't keep it past drop()

§void set(T value)source · definition

replace it (dropping the old one)

§void drop()source · definition

unlocks