[pkg-gnupg-maint] Bug#841143: [PATCH 4/4] gpg agent lockup fix: Interrupt main loop when active_connections_value==0

Ian Jackson ijackson at chiark.greenend.org.uk
Sun Jan 8 22:46:29 UTC 2017


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 <ijackson at 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



More information about the pkg-gnupg-maint mailing list