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 /doc/ref/api-evaluation.texi | |
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 'doc/ref/api-evaluation.texi')
-rw-r--r-- | doc/ref/api-evaluation.texi | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi index 7d67d9a21..d3e6c8cbb 100644 --- a/doc/ref/api-evaluation.texi +++ b/doc/ref/api-evaluation.texi @@ -1279,6 +1279,10 @@ with no arguments. @deffn {Scheme Procedure} stop-server-and-clients! Closes the connection on all running server sockets. + +Please note that in the current implementation, the REPL threads are +cancelled without unwinding their stacks. If any of them are holding +mutexes or are within a critical section, the results are unspecified. @end deffn @c Local Variables: |