Skip to content

@sync

Import this module with import @sync.

Synchronization primitives for thread-safe access to shared data. Compiler-only feature; requires POSIX threads.

Function Signature Description
mutex () -> Mutex Create a new mutex
lock (m Mutex) Acquire a mutex
unlock (m Mutex) Release a mutex
try_lock (m Mutex) Try to acquire a mutex (non-blocking)
destroy (m Mutex) Destroy a mutex