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 <ijack...@chiark.greenend.org.uk>

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.11.0

Reply via email to