Implement signal-driven time tracking.
authorBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 21:41:48 +0000 (14:41 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 22:21:30 +0000 (15:21 -0700)
commita837a3820985a078834cb6bd9b754572a5c2e4ee
tree95c1f60d2a98ab2ee32c1e49dafd4c5555074496
parentb67da66b07a77d9bd67926f83c5ae7aa57f1dba9
Implement signal-driven time tracking.

Checking the current time only when a periodic timer expires allows us
to reduce the number of system calls to obtain the current time to 10 per
second (from an arbitrary number) plus one per poll loop.

This fixes poll_block() to properly handle being interrupted.
Otherwise, a timeout longer than the interval between signals will never
complete (because it will restart from the beginning after every
signal).
include/timeval.h
lib/Makefile.am
lib/poll-loop.c
lib/timeval.c [new file with mode: 0644]