diff options
author | Mark H Weaver <mhw@netris.org> | 2014-02-04 12:18:22 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-02-12 11:21:46 -0500 |
commit | 5ecc58113a0a50d7a5840e9bfccce25b4f8b30ce (patch) | |
tree | 91878c7b19254d313e5b75e00c85c1c3dc8b2e22 /lib/tempname.h | |
parent | b61025ce0f6f14541b23d93f14dfc60022b91ad6 (diff) | |
download | guile-5ecc58113a0a50d7a5840e9bfccce25b4f8b30ce.tar.gz |
REPL Server: Fix 'stop-server-and-clients!'.
* module/system/repl/server.scm: Import (ice-9 match) and (srfi srfi-1).
(*open-sockets*): Add comment. This is now a list of pairs with a
'force-close' procedure in the cdr.
(close-socket!): Add comment noting that it is unsafe to call this
from another thread.
(add-open-socket!): Add 'force-close' argument, and put it in the cdr
of the '*open-sockets*' entry.
(stop-server-and-clients!): Use 'match'. Remove the first element
from *open-sockets* immediately. Call the 'force-close' procedure
instead of 'close-socket!'.
(errs-to-retry): New variable.
(run-server): Add a pipe, used in the 'force-close' procedure to
cleanly shut down the server. Put the server socket into non-blocking
mode. Use 'select' to monitor both the server socket and the pipe.
Don't call 'add-open-socket!' on the client-socket. Close the pipe
and the server socket cleanly when we're asked to shut down.
(serve-client): Call 'add-open-socket!' with a 'force-close' procedure
that cancels the thread. Set the thread cleanup handler to call
'close-socket!', instead of calling it in the main body.
* doc/ref/api-evaluation.texi (REPL Servers): Add a caveat to the manual
entry for 'stop-servers-and-clients!'.
Diffstat (limited to 'lib/tempname.h')
0 files changed, 0 insertions, 0 deletions