BaseServer.shutdown is documented as "Tells the serve_forever() loop to stop and waits until it does." The docstring is much more explicit: """Stops the serve_forever loop. Blocks until the loop has finished. This must be called while serve_forever() is running in another thread, or it will deadlock.""" Combined with #2302 I'd rewrite both (rst and docstring) as: BaseServer.shutdown(): Tells the serve_forever() loop to stop, and waits until the loop has finished. This must be called after serve_forever() has started and while it is running in another thread, or the shutdown() call will deadlock."
Hello, I've refreshed this patch (correct the file name & because it applies now with an offset), other than that it seems ok: can someone review (it's quite small :) and apply it? Thanks, Sandro