tur/mutex
stdlib/mutex.tur
defn
mutex-new
(mutex-new :ptr<void>)
allocate and initialise a new POSIX mutex.
Since: Phase T19-C
defn
mutex-lock
(mutex-lock [m :ptr<void>] :nil)
acquire the mutex, blocking until it is available.
Parameters
| m | mutex handle returned by mutex-new |
Since: Phase T19-C
defn
mutex-unlock
(mutex-unlock [m :ptr<void>] :nil)
release the mutex.
Parameters
| m | mutex handle returned by mutex-new |
Since: Phase T19-C
defn
mutex-try-lock
(mutex-try-lock [m :ptr<void>] :bool)
attempt to acquire the mutex without blocking.
Parameters
| m | mutex handle returned by mutex-new |
Since: Phase T19-C
defn
mutex-free
(mutex-free [m :ptr<void>] :nil)
destroy the mutex and release its memory.
Parameters
| m | mutex handle returned by mutex-new |
Since: Phase T19-C