chickadee » srfi-18 » thread-start!

thread-start! threadprocedure

Makes thread runnable. The thread must be a new thread. thread-start! returns the thread.

    (let ((t (thread-start! (make-thread (lambda () (write 'a))))))
      (write 'b)
      (thread-join! t))             ==>  ''unspecified''
                                         ''after writing'' ab ''or'' ba

NOTE: It is useful to separate thread creation and thread activation to avoid the race condition that would occur if the created thread tries to examine a table in which the current thread stores the created thread. See the last example of thread-terminate! which contains mutually recursive threads.