Threads trouble
Emilio Lopes <[email protected]> Mon, 24 Apr 2006 20:33:46 +0200
| Newsgroups | gmane.lisp.scheme.scsh |
|---|---|
| Organization | The Church of Emacs |
| Message-ID | <[email protected]> |
Hello,
consider this program:
;; ,open threads
(define-syntax run/strings-status
(syntax-rules ()
((_ epf ...)
(call-with-values
(lambda ()
(run/port+proc epf ...))
(lambda (port proc)
(let* ((string-list (port->string-list port))
(status (wait proc)))
(close-input-port port)
(values string-list status)))))))
(define my-ls
(lambda ()
(receive (out rc)
(run/strings-status (ls))
out)))
Now try:
> (my-ls)
'("COPYING" "INSTALL" "Makefile" ...)
> (spawn (lambda () (run (ls))))
> COPYING Makefile.in build config.guess config.sub doc go scheme scsh-config.in
INSTALL README c config.log configure emacs install-sh scsh scsh.image
Makefile RELEASE cig config.status configure.in gdbinit ps-compiler scsh-config scshvm
So far, so good. But now try this:
> (spawn my-ls)
>
As you see, there is no output from `ls', as I expected. This happens
with 0.6.6 as well as with 0.6.7-rc1.
Is this a bug or am I overseeing something obvious?
Thanks for your time.
--
EmÃlio C. Lopes
Munich, Germany