6.1 Exported definitions

6.1.1 Functions

Function: add-jobPOOL JOB

Add a job to the pool.
pool – A threadpool instance as created by make-threadpool.
job – A function with zero arguments.
* The pool must have been started.
* The pool must not be in stopping state.
* The pool must not be in stopped state.

Create a thread pool.
name – Name of the pool.
size – Number of worker threads.
max-queue-size – The maximum number of pending jobs
resignal-job-conditions – if t then conditions signalled by the worker will be
resignalled as errors

Stop the thread pool.
Returns when all threads have stopped.
pool – A threadpool instance created by make-threadpool.
force-destroy-timeout-seconds – An optional timeout after all still active
threads will be destroyed.
* All queued jobs will be executed.
* The stopping thread must not be a worker thread of the pool (to avoid deadlock).

6.2 Internal definitions

6.2.1 Macros

Macro: poll(&key TIMEOUT-SECONDS) TEST-BODY TIMEOUT-BODY

Evaluates repeatedly test-body. If the test-body returns true the loop
terminates. If the timeout has been reached the timeout-body is executed
and the loop terminates.
timeout-seconds – the timeout in seconds or nil for no timeout.
test-body – The form to be evaluated repeatedly. It is up to the
test body to take care of CPU usage. The test-body is evaluated
at least once.
timeout-body – The form to be evaluated when a timeout occurs.