Next: , Previous: , Up: Threads   [Contents][Index]

5.15.2 Creating Threads

The make-thread function may be used to create threads that execute within the current thread context (dynamic root). Each thread is represented by a lisp object.

Function: threadp arg

Return true if lisp object arg represents a thread of execution in the lisp environment.

Function: make-thread thunk #!optional name

Create and return a new thread of execution; it will initially invoke the zero-parameter function thunk. If the call to thunk returns the thread is automatically deleted.

If name is defined, it is a string naming the current thread.

Function: make-suspended-thread #!optional name

Similar to make-thread, except that the newly created thread will be immediately suspended from running.

Function: current-thread

Returns the currently executing thread. If no threads have been created yet in the current dynamic root (i.e. there is a single “implicit” thread) then false is returned.

Function: all-threads

Returns a newly-created list containing all threads in the current dynamic root. If no threads have been created yet, returns a null list.