From ff6c2e7f15b0ff68c272a2b62a94989fc73e2374 Mon Sep 17 00:00:00 2001 From: Ashish Bansal Date: Sun, 8 Dec 2019 00:09:38 +0530 Subject: [PATCH] Fix race condition on stopping lsp client --- pylspclient/lsp_endpoint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pylspclient/lsp_endpoint.py b/pylspclient/lsp_endpoint.py index 48f2df4..fc258a3 100644 --- a/pylspclient/lsp_endpoint.py +++ b/pylspclient/lsp_endpoint.py @@ -90,6 +90,9 @@ class LspEndpoint(threading.Thread): self.event_dict[current_id] = cond cond.acquire() self.send_message(method_name, kwargs, current_id) + if self.shutdown_flag: + return None + cond.wait() cond.release() result, error = self.response_dict[current_id]