No matching definitions.

tur/condvar

stdlib/condvar.tur

POSIX condition variable (pthread_cond_t) wrapped as ptr<void>.

Since: Phase T19-C

defopaque

CondVar

(CondVar)
defn

condvar-new

(condvar-new :CondVar)

allocate and initialise a new POSIX condition variable.

A CondVar handle to a heap-allocated pthread_cond_t.

(let [c (condvar-new)] ...)  ; => CondVar

Since: Phase T19-C

defn

condvar-wait

(condvar-wait [c :CondVar ^borrow m :Mutex] :nil)

atomically release the mutex and wait for a signal on the condition variable.

ccondvar handle returned by condvar-new
mmutex handle (from mutex-new) that the caller already holds
(condvar-wait c m)

Since: Phase T19-C

defn

condvar-signal

(condvar-signal [c :CondVar] :nil)

wake one thread waiting on the condition variable.

ccondvar handle returned by condvar-new
(condvar-signal c)

Since: Phase T19-C

defn

condvar-broadcast

(condvar-broadcast [c :CondVar] :nil)

wake all threads waiting on the condition variable.

ccondvar handle returned by condvar-new
(condvar-broadcast c)

Since: Phase T19-C

defn

condvar-free

(condvar-free [c :CondVar] :nil)

destroy the condition variable and release its memory.

ccondvar handle returned by condvar-new
(condvar-free c)

Since: Phase T19-C