(make-thread (lambda () (write-line "Hello, world")))
Class precedence list:
thread, structure-object, tThread type. Do not rely on threads being structs as it may change in future versions.
Create a new thread of
namethat runsfunction. When the function returns the thread exits. The return values offunctionare kept around and can be retrieved byjoin-thread.
Suspend current thread until
threadexits. Returns the result values of the thread function. If the thread does not exit normally, returndefaultif given or else signaljoin-thread-error.
Class precedence list:
join-thread-error, error, serious-condition, condition, tJoining thread failed.
Class precedence list:
interrupt-thread-error, error, serious-condition, condition, tInterrupting thread failed.
Interrupt the live
threadand make it runfunction. A moderate degree of care is expected for use ofinterrupt-thread, due to its nature: if you interrupt a thread that was holding important locks then do something that turns out to need those locks, you probably won't like the effect.functionruns with interrupts disabled, butwith-interruptsis allowed in it. Keep in mind that many things may enable interrupts (GET-MUTEX when contended, for instance) so the first thing to do is usually awith-interruptsor awithout-interrupts. Within a thread interrupts are queued, they are run in same the order they were sent.