terminates the thread.
See also: RETURN-FROM-THREAD, ABORT-THREAD."
- #!-sb-thread (declare (ignore function name arguments))
+ #!-sb-thread (declare (ignore function name arguments ephemeral))
#!-sb-thread (error "Not supported in unithread builds.")
#!+sb-thread (assert (or (atom arguments)
(null (cdr (last arguments))))
"Argument passed to ~S, ~S, is an improper list."
'make-thread arguments)
#!+sb-thread
- (tagbody
+ (let ((thread (%make-thread :name name :%ephemeral-p ephemeral)))
(with-mutex (*make-thread-lock*)
- (let* ((thread (%make-thread :name name :%ephemeral-p ephemeral))
- (setup-sem (make-semaphore :name "Thread setup semaphore"))
+ (let* ((setup-sem (make-semaphore :name "Thread setup semaphore"))
(real-function (coerce function 'function))
(arguments (if (listp arguments)
arguments
;; thread.
(without-interrupts
(with-pinned-objects (initial-function)
- (let ((os-thread
- (%create-thread
- (get-lisp-obj-address initial-function))))
- (when (zerop os-thread)
- (go :cant-spawn))
- (wait-on-semaphore setup-sem)
- (return-from make-thread thread))))))
- :cant-spawn
- (error "Could not create a new thread.")))
+ (if (zerop
+ (%create-thread (get-lisp-obj-address initial-function)))
+ (setf thread nil)
+ (wait-on-semaphore setup-sem))))))
+ (or thread (error "Could not create a new thread."))))
(defun join-thread (thread &key (default nil defaultp) timeout)
#!+sb-doc
(interrupt-thread thread #'break)
Short version: be careful out there."
- #!+win32
+ #!+(and (not sb-thread) win32)
+ #!+(and (not sb-thread) win32)
(declare (ignore thread))
- #!+win32
(with-interrupt-bindings
(with-interrupts (funcall function)))
- #!-win32
+ #!-(and (not sb-thread) win32)
(let ((os-thread (thread-os-thread thread)))
(cond ((not os-thread)
(error 'interrupt-thread-error :thread thread))