[Openmcl-devel] Threads want *terminal-io*, but do nothing once they get it.
Christian Nybø
chr at nybo.no
Mon Jul 11 04:18:52 PDT 2005
On Jun 22, 2005, at 11:34, Christian Nybø wrote:
> > Break in process slave(3115): Expected newpos to be 9, fd is at 2048
> > While executing: "Unknown"
>
>
> ;;;
> ;;; #<PROCESS slave(3115) [Active] #x68BAB2E> requires access to
> Shared Terminal Input
> ;;;
>
> ()
> NIL
> ? (:y 3115)
> ?
>
> Should it not give me a debugger prompt here?
I guess I could add some context to the question above.
I run slime 1.2.1, openmcl 0.14.3, xemacs 21.4.
A thread hangs, and has output a message like the above in the
*inferior-lisp* buffer.
With slime, I was wondering what am I supposed to do to get to the
debugger that's waiting in the process slave(3115)?
:y calls this function from l1-streams.lisp:
(defun %%yield-terminal-to (&optional process)
(let* ((shared-resource
(if (typep *terminal-io* 'two-way-stream)
(input-stream-shared-resource
(two-way-stream-input-stream *terminal-io*)))))
(when shared-resource (%yield-shared-resource shared-resource
process))))
When running under Slime, *terminal-io* is a synonym-stream, and
there is no method for (two-way-stream-input-stream *terminal-io*)
I changed %%yield-terminal to:
(defun %%yield-terminal-to (&optional process)
(let* ((stream (if (typep *terminal-io* 'synonym-stream)
(symbol-value (synonym-stream-symbol *terminal-io*))
*terminal-io*))
(shared-resource
(if (typep stream 'two-way-stream)
(input-stream-shared-resource
(two-way-stream-input-stream stream)))))
(when shared-resource (%yield-shared-resource shared-resource
process))))
and then (:y <process>) works in Slime.
(:y) does not work yet, though, because there's a misplaced paren in
the definition of the toplevel command :y in l1-readloops-lds.lisp:
(define-toplevel-command
:global y (&optional p) "Yield control of terminal-input to process
whose name or ID matches <p>, or to any process if <p> is null"
(if p
(let* ((proc (find-process p)))
(%%yield-terminal-to proc) ;may be nil
(%%yield-terminal-to nil))))
As written above, that last IF is a WHEN, I suppose it should be:
(define-toplevel-command
:global y (&optional p) "Yield control of terminal-input to process
whose name or ID matches <p>, or to any process if <p> is null"
(if p
(let* ((proc (find-process p)))
(%%yield-terminal-to proc)) ;may be nil
(%%yield-terminal-to nil)))
;; or, as I am still in school:
(define-toplevel-command
:global y (&optional p) "Yield control of terminal-input to process
whose name or ID matches <p>, or to any process if <p> is null"
(%%yield-terminal-to (when p (find-process p)))) ;may be nil
--
chr
More information about the Openmcl-devel
mailing list