chiark / gitweb /
agent: Create framework of scheduled timers.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 1 Nov 2016 01:27:36 +0000 (21:27 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)
commit22f22d14401eec07bb2907f50d929d54f83dc2e5
tree9b3a07608e18dead75011ba303de3ef27de307ed
parent0c70b627cc71beede80c727abb5fe68f798df07d
agent: Create framework of scheduled timers.

agent/gpg-agent.c (handle_tick): Remove intermittent call to
check_own_socket.
(tv_is_set): Add inline helper function for readability.
(handle_connections) Create general table of pending scheduled
timeouts.

--

handle_tick() does fine-grained, rapid activity.  check_own_socket()
is supposed to happen at a different interval.

Mixing the two of them makes it a requirement that one interval be a
multiple of the other, which isn't ideal if there are different delay
strategies that we might want in the future.

Creating an extensible regular timer framework in handle_connections
should make it possible to have any number of cadenced timers fire
regularly, without requiring that they happen in cadences related to
each other.

It should also make it possible to dynamically change the cadence of
any regularly-scheduled timeout.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic gpg-agent-idling
Gbp-Pq: Name 0001-agent-Create-framework-of-scheduled-timers.patch
agent/gpg-agent.c