redesign exiting SBCL
commitf0da2f63aa0b4e6d4dbf884854a4bf2dfdd01fc0
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 6 Dec 2011 11:44:06 +0000 (6 13:44 +0200)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 29 Apr 2012 18:18:53 +0000 (29 21:18 +0300)
tree0a631da084a714c4bb3d39a790b8d3818705b381
parent4ce962e92568e52624959d8abc83f609abc3605c
redesign exiting SBCL

 Deprecate QUIT. It occupies an uncomfortable niche between processes
 and threads, and doesn't actually do what it says on the tin unless
 you call it from the main thread.

 SIGTERM now uses EXIT, and doesn't depend on sessions.

 WITH-DEADLINE (:SECONDS NIL :OVERRIDE T) can now be used to ignore
 deadlines.

 JOIN-THREAD on the main thread now blocks indefinitely instead of
 claiming the thread did not exit normally.

 New functions:

  * SB-EXT:EXIT. Always exits the process. Takes keywords :CODE,
    :ABORT, and :TIMEOUT. Code is the exit status. Abort controls if
    the exit is clean (unwind, exit-hooks, terminate other threads) or
    dirty. Timeout controls how long to wait for other threads to
    finish.

  * SB-THREAD:RETURN-FROM-THREAD. Normal termination for current
    thread -- equivalent to return from the thread function with the
    specified values. Takes keyword :ALLOW-EXIT, which determines if
    returning from the main thread is an error, or equivalent to
    calling EXIT :CODE 0.

  * SB-THREAD:ABORT-THREAD. Abnormal termination for current thread --
    equivalent to invoking the initial ABORT restart estabilished by
    MAKE-THREAD (previously known as TERMINATE-THREAD, but ANSI
    recommends there to always be an ABORT restart.) Takes keyword
    :ALLOW-EXIT, which determines if aborting the main thread is an
    error, or equivalent to calling EXIT :CODE 1.

  * SB-THREAD:MAIN-THREAD-P. Let's you determine if a given thread is
    the main thread of the process. This is important for some
    functions on some operating systems -- and RETURN-FROM-THREAD and
    ABORT-THREAD also need it.

  * SB-THREAD:MAIN-THREAD. Returns the main thread object. Convenient
    for when you need to eg. load a foreign library in the main
    thread.
50 files changed:
NEWS
contrib/asdf-module.mk
contrib/sb-aclrepl/repl.lisp
contrib/sb-concurrency/tests/test-gate.lisp
contrib/sb-executable/sb-executable.lisp
contrib/sb-posix/posix-tests.lisp
doc/manual/create-contrib-doc-list.lisp
doc/manual/make-tempfiles.sh
doc/manual/start-stop.texinfo
doc/manual/threading.texinfo
doc/sbcl.1
make-windows-installer.sh
package-data-list.lisp-expr
src/code/cold-init.lisp
src/code/deadline.lisp
src/code/debug.lisp
src/code/save.lisp
src/code/target-signal.lisp
src/code/target-thread.lisp
src/code/toplevel.lisp
src/code/unix.lisp
tests/callback.impure.lisp
tests/clos-cache.impure.lisp
tests/compiler.impure.lisp
tests/condition-wait-sigcont.lisp
tests/core.test.sh
tests/custom-userinit.lisp
tests/debug.impure.lisp
tests/dynamic-extent.impure.lisp
tests/enc-cn.impure.lisp
tests/enc-jpn.impure.lisp
tests/external-format.impure.lisp
tests/filesys.test.sh
tests/foreign.test.sh
tests/full-eval.impure.lisp
tests/interface.test.sh
tests/kill-non-lisp-thread.impure.lisp
tests/run-tests.lisp
tests/script.test.sh
tests/step.impure.lisp
tests/stream.test.sh
tests/stress-gc.sh
tests/swap-lispobjs.impure.lisp
tests/threads.impure.lisp
tests/threads.pure.lisp
tests/threads.test.sh
tests/undefined-classoid-bug.test.sh
tests/unwind-to-frame-and-call.impure.lisp
tests/win32-foreign-stack-unwind.impure.lisp
tools-for-build/ldso-stubs.lisp