std1.0.0-beta-7 SafeC docs

std :: async::sync

Struct std::AsyncMutex

#include <std/async/sync.h> source

struct AsyncMutex {
    int locked;
    struct WaitList waiters;
    struct Spinlock lk;
}

Fields

§int lockedsource
§struct WaitList waiterssource

Methods

§static struct AsyncMutex new()source · definition
§struct MutexLock lock()source · definition

Future: Ready once this task holds the lock.

§int try_lock()source · definition

1 if acquired

§void unlock()source · definition

and wake a waiter

§int is_locked() constsource · definition