chiark / gitweb /
gpg-agent connection count: Abstract away all direct accesses
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 18:03:07 +0000 (18:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 20:46:45 +0000 (20:46 +0000)
commit6f975778d5e731c63062f2617ff201e11d557e1b
tree765ea5d182ccb4310fbbc68ed7ff3cbef301bbd2
parentd2523babc0b7f653e88bd08d5c63f1d8df8db72d
gpg-agent connection count: Abstract away all direct accesses

This variable needs to be protected with a mutex.  We don't want
anyone to access it directly.  So introduce a helper function
adjust_agent_active_connections to increment/decrement it, and replace
all direct accesses.

Also replace a couple of direct read-only accesses with calls to the
existing function get_agent_active_connection_count.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
agent/gpg-agent.c