tur/thread

stdlib/thread.tur
defn

thread-spawn-fn

(thread-spawn-fn [fn-ptr :ptr<void> arg :ptr<void>] :ptr<void>)

spawn a new OS thread calling fn-ptr with arg.

fn-ptrC function pointer of type void *(*)(void *)
argopaque argument forwarded to fn-ptr

Since: Phase T19-C

defn

thread-join

(thread-join [t :ptr<void>] :nil)

wait for a thread to finish and free its handle.

tthread handle returned by thread-spawn-fn

Since: Phase T19-C

defn

thread-detach

(thread-detach [t :ptr<void>] :nil)

detach a thread (it cleans up itself on exit) and free the handle.

tthread handle returned by thread-spawn-fn

Since: Phase T19-C

defn

thread-id

(thread-id :int)

return an integer identifier for the calling OS thread.

Since: Phase T19-C