chiark / gitweb /
gpg agent lockup fix: Interrupt main loop when active_connections_value==0 841143-bugfix
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 18:55:17 +0000 (18:55 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 20:46:45 +0000 (20:46 +0000)
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@chiark.greenend.org.uk>
MORE

agent/gpg-agent.c

index 836b31724f674b790df1c788e0939e818eadc114..121bb0ed4f6a7e8b9d3486c4855e3811776db57e 100644 (file)
@@ -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();
 }