From 2dda28817d505107bb37f55e06b6287cb49ae40b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Jan 2017 18:55:17 +0000 Subject: [PATCH] gpg agent lockup fix: Interrupt main loop when active_connections_value==0 Otherwise, if this happens (in a parallel thread) after the main loop found shutdown_pending and checked active_connections>=0, the main loop could enter a select which would never wake up. Signed-off-by: Ian Jackson MORE --- agent/gpg-agent.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 836b317..121bb0e 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -2029,6 +2029,8 @@ adjust_agent_active_connections (int delta) { lock_active_connections(); active_connections_value += delta; + if (active_connections_value == 0) + interrupt_main_thread_loop (); unlock_active_connections(); } -- 2.30.2