Thread module

lock

procedure2 overloadsSource

Takes the mutex, waiting until no other thread holds it. Pair every lock with an unlock.

lock :: (m: *Mutex)

Parameters

m: *Mutex
lock :: (m: *Mutex)

Takes the mutex, waiting until no other thread holds it. Pair every lock with an unlock.

Parameters

m: *Mutex
Example↗
mutex: Mutex;
init(*mutex);
defer destroy(*mutex);

lock(*mutex);
defer unlock(*mutex);

See also