Kristoffer Kvello wrote:
> I wanted to see if I could connect with SLIME to a running
> multi-threaded application in SBCL and debug any threads that had had
> an error signaled in them. To my delight I found that I could, but I
> also noticed that some threads did not respond either to a debug or a
> terminate request.
> Experimenting with creating and terminating threads in SBCL started
> from a shell (i.e. not with SLIME) showed that some threads will not
> terminate, and it appears that the interrupt request is received by
> them but not acted upon (see transcript below).
> Is this a bug or am I doing something wrong?
This is a bug. If you load the following bit of code before
doing this, everything should work fine.
I'll fix this in CVS soonish.
(The bug was caused by change to WITHOUT-INTERRUPT semantics,
which caused the CONDITION-WAIT in GET-FOREGROUND to become
(defmacro with-session-lock ((session) &body body)
`(with-mutex ((session-lock ,session))
(defun get-foreground ()
(let ((was-foreground t))
(let ((int-t (session-interactive-threads *session*)))
(when (eq (car int-t) *current-thread*)
(format *query-io* "Resuming thread ~A~%" *current-thread*))
(return-from get-foreground t))
(setf was-foreground nil)
(unless (member *current-thread* int-t)
(setf (cdr (last int-t))