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.
Parameters
| fn-ptr | C function pointer of type void *(*)(void *) | |
| arg | opaque 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.
Parameters
| t | thread 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.
Parameters
| t | thread 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