X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-thread.lisp;fp=src%2Fcode%2Ftarget-thread.lisp;h=ec60aab478db8af9d6ece68bdaba5e25276124fd;hb=83fc8f3154fa6ffe1c9451399eb23586ae07357d;hp=0ec0b37955211d8ee62531de0cc98d93f01e2bf6;hpb=81678bf18f95daf6b9b6f1a4ae14571796c1459a;p=sbcl.git diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index 0ec0b37..ec60aab 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -220,6 +220,14 @@ potentially stale even before the function returns, as the thread may exit at any time." (thread-%alive-p thread)) +(defun thread-emphemeral-p (thread) + #!+sb-doc + "Return T if THREAD is `ephemeral', which indicates that this thread is +used by SBCL for internal purposes, and specifically that it knows how to +to terminate this thread cleanly prior to core file saving without signalling +an error in that case." + (thread-%ephemeral-p thread)) + ;; A thread is eligible for gc iff it has finished and there are no ;; more references to it. This list is supposed to keep a reference to ;; all running threads. @@ -1341,7 +1349,7 @@ have the foreground next." ;;;; The beef -(defun make-thread (function &key name arguments) +(defun make-thread (function &key name arguments ephemeral) #!+sb-doc "Create a new thread of NAME that runs FUNCTION with the argument list designator provided (defaults to no argument). Thread exits when @@ -1362,7 +1370,7 @@ See also: RETURN-FROM-THREAD, ABORT-THREAD." #!+sb-thread (tagbody (with-mutex (*make-thread-lock*) - (let* ((thread (%make-thread :name name)) + (let* ((thread (%make-thread :name name :%ephemeral-p ephemeral)) (setup-sem (make-semaphore :name "Thread setup semaphore")) (real-function (coerce function 'function)) (arguments (if (listp arguments)