lispdoc - results for thread

(bordeaux-threads:threadp object)
Function: Returns true if object is a thread, otherwise NIL.
(bordeaux-threads:make-lock &optional name)
Function: Creates a lock (a mutex) whose name is NAME. If the system does not support multiple threads this will still return some object, but it may not be used for very much.
Function: Returns a sequence of all of the threads. This may not be freshly-allocated, so the caller should not modify it.
(bordeaux-threads:make-thread function &key name
 (initial-bindings *default-special-bindings*))
Function: Creates and returns a thread named NAME, which will call the function FUNCTION with no arguments: when FUNCTION returns, the thread terminates. NAME defaults to "Anonymous thread" if unsupplied. On systems that do not support multi-threading, MAKE-THREAD will signal an error. The interaction between threads and dynamic variables is in some cases complex, and depends on whether the variable has only a global binding (as established by e.g. DEFVAR/DEFPARAMETER/top-level SETQ) or has been bound locally (e.g. with LET or LET*) in the calling thread. - Global bindings are shared between threads: the initial value of a global variable in the new thread will be the same as in the parent, and an assignment to such a variable in any thread will be visible to all threads in which the global binding is visible. - Local bindings, such as the ones introduced by INITIAL-BINDINGS, are local to the thread they are introduced in, except that - Local bindings in the the caller of MAKE-THREAD may or may not be shared with the new thread that it creates: this is implementation-defined. Portable code should not depend on particular behaviour in this case, nor should it assign to such variables without first rebinding them in the new thread.
(bordeaux-threads:thread-name thread)
Function: Returns the name of the thread, as supplied to MAKE-THREAD.
(bordeaux-threads:join-thread thread)
Function: Wait until THREAD terminates. If THREAD has already terminated, return immediately.
(bordeaux-threads:release-lock lock)
Function: Release LOCK. It is an error to call this unless the lock has previously been acquired (and not released) by the same thread. If other threads are waiting for the lock, the ACQUIRE-LOCK call in one of them will now be able to continue. This function has no interesting return value.
(bordeaux-threads:with-timeout (timeout) &body body)
Function: Execute `BODY' and signal a condition of type TIMEOUT if the execution of BODY does not complete within `TIMEOUT' seconds. On implementations which do not support WITH-TIMEOUT natively and don't support threads either it has no effect.
(bordeaux-threads:acquire-lock lock &optional (wait-p t))
Function: Acquire the lock LOCK for the calling thread. WAIT-P governs what happens if the lock is not available: if WAIT-P is true, the calling thread will wait until the lock is available and then acquire it; if WAIT-P is NIL, ACQUIRE-LOCK will return immediately. ACQUIRE-LOCK returns true if the lock was acquired and NIL otherwise. This specification does not define what happens if a thread attempts to acquire a lock that it already holds. For applications that require locks to be safe when acquired recursively, see instead MAKE-RECURSIVE-LOCK and friends.
Function: Allows other threads to run. It may be necessary or desirable to call this periodically in some implementations; others may schedule threads automatically. On systems that do not support multi-threading, this does nothing.
(bordeaux-threads:condition-wait condition-variable lock)
Function: Atomically release LOCK and enqueue the calling thread waiting for CONDITION-VARIABLE. The thread will resume when another thread has notified it using CONDITION-NOTIFY; it may also resume if interrupted by some external event or in other implementation-dependent circumstances: the caller must always test on waking that there is threading to be done, instead of assuming that it can go ahead. However and for whatever reason the thread is resumed, the system always reacquires LOCK before returning to the caller. It is an error to call this unless from the thread that holds LOCK. In an implementation that does not support multiple threads, this function signals an error.
(bordeaux-threads:destroy-thread thread)
Function: Terminates the thread THREAD, which is an object as returned by MAKE-THREAD. This should be used with caution: it is implementation-defined whether the thread runs cleanup forms or releases its locks first. Destroying the calling thread is an error.
Function: Returns the thread object for the calling thread. This is the same kind of object as would be returned by MAKE-THREAD.
(bordeaux-threads:condition-notify condition-variable)
Function: Notify at least one of the threads waiting for CONDITION-VARIABLE. It is implementation-dependent whether one or more than one (and possibly all) threads are woken, but if the implementation is capable of waking only a single thread (not all are) this is probably preferable for efficiency reasons. The order of wakeup is unspecified and does not necessarily relate to the order that the threads went to sleep in. CONDITION-NOTIFY has no useful return value. In an implementation that does not support multiple threads, it has no effect.
(bordeaux-threads:interrupt-thread thread function &rest args)
Function: Interrupt THREAD and cause it to evaluate FUNCTION before continuing with the interrupted path of execution. This may not be a good idea if THREAD is holding locks or doing anything important. On systems that do not support multiple threads, this function signals an error.
Function: If the host implementation uses user-level threads, start the scheduler and multiprocessing, otherwise do nothing. It is safe to call repeatedly.
(bordeaux-threads:with-lock-held (place) &body body)
Function: Evaluates BODY with the lock named by PLACE, the value of which is a lock created by MAKE-LOCK. Before the forms in BODY are evaluated, the lock is acquired as if by using ACQUIRE-LOCK. After the forms in BODY have been evaluated, or if a non-local control transfer is caused (e.g. by THROW or SIGNAL), the lock is released as if by RELEASE-LOCK. Note that if the debugger is entered, it is unspecified whether the lock is released at debugger entry or at debugger exit when execution is restarted.
(bordeaux-threads:thread-alive-p thread)
Function: Returns true if THREAD is alive, that is, if DESTROY-THREAD has not been called on it.
(bordeaux-threads:make-recursive-lock &optional name)
Function: Create and return a recursive lock whose name is NAME. A recursive lock differs from an ordinary lock in that a thread that already holds the recursive lock can acquire it again without blocking. The thread must then release the lock twice before it becomes available for another thread.
Variable: This should be set to T if the running instance has thread support.
(bordeaux-threads:acquire-recursive-lock lock)
Function: As for ACQUIRE-LOCK, but for recursive locks.
(bordeaux-threads:release-recursive-lock lock)
Function: Release the recursive LOCK. The lock will only become free after as many Release operations as there have been Acquire operations. See RELEASE-LOCK for other information.
Variable: Standard bindings of printer/reader control variables as per CL:WITH-STANDARD-IO-SYNTAX.
(bordeaux-threads:make-condition-variable &key name)
Function: Returns a new condition-variable object for use with CONDITION-WAIT and CONDITION-NOTIFY.
Variable: This variable holds an alist associating special variable symbols to forms to evaluate. Special variables named in this list will be locally bound in the new thread before it begins executing user code. This variable may be rebound around calls to MAKE-THREAD to add/alter default bindings. The effect of mutating this list is undefined, but earlier forms take precedence over later forms for the same symbol, so defaults may be overridden by consing to the head of the list.
(bordeaux-threads:with-recursive-lock-held (place) &body body)
Function: Evaluates BODY with the recursive lock named by PLACE, which is a reference to a recursive lock created by MAKE-RECURSIVE-LOCK. See WITH-LOCK-HELD etc etc
Type: A taskmaster that starts one thread for listening to incoming requests and one thread for each incoming connection. This is the default taskmaster implementation for multi-threaded Lisp implementations.
(third list)
Function: Return the 3rd object in a list or NIL if there is no 3rd object.
(defun export-prefix (export) (third export))
Mentioned in:
CLtL2 - 15.2. Lists
On Lisp - Need for Macros