Next: Mutexes and Condition Variables, Previous: Continuation Barriers, Up: Scheduling
Return the thread that called this function.
Call
thunk
in a new thread and with a new dynamic state, returning the new thread. The procedure thunk is called viawith-continuation-barrier
.When handler is specified, then thunk is called from within a
catch
with tag#t
that has handler as its handler. This catch is established inside the continuation barrier.Once thunk or handler returns, the return value is made the exit value of the thread and the thread is terminated.
Call body in a new thread, passing it body_data, returning the new thread. The function body is called via
scm_c_with_continuation_barrier
.When handler is non-
NULL
, body is called viascm_internal_catch
with tagSCM_BOOL_T
that has handler and handler_data as the handler and its data. This catch is established inside the continuation barrier.Once body or handler returns, the return value is made the exit value of the thread and the thread is terminated.
Wait for thread to terminate and return its exit value. Threads that have not been created with
call-with-new-thread
orscm_spawn_thread
have an exit value of#f
.
Return
#t
iff thread has exited.
If one or more threads are waiting to execute, calling yield forces an immediate context switch to one of them. Otherwise, yield has no effect.
Higher level thread procedures are available by loading the
(ice-9 threads)
module. These provide standardized
thread creation.