← all modules
module

stdlib::sync

defined in C:\Users\bye45\.glide\bin/src/stdlib/sync.glide

A mutex protecting a value of type T. Use `.with()` for the common

struct struct Mutex

A mutex protecting a value of type T. Use .with() for the common load-mutate-store pattern, or .lock() / .get() / .set() / .unlock() for explicit control.

Re-entering the lock from the same coro / thread that already holds it is undefined behaviour — pthread mutexes are not recursive.

struct struct Atomic

A lock-free i64. Use for shared counters, flags, sequence numbers, or any case where Mutex<int> would dominate the contention picture.

struct struct WaitGroup

A counter you can wait to reach zero. Mirrors Go's sync.WaitGroup: add(n) before spawning, done() from each worker, wait() from the parent. Calling add(n) concurrently with wait() is racy — add ahead of spawning.