poll-loop: Track the poll timeout as an absolute, not a relative time.
authorBen Pfaff <blp@nicira.com>
Mon, 19 Dec 2011 22:28:42 +0000 (14:28 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 19 Dec 2011 22:53:48 +0000 (14:53 -0800)
commitcee03df4f53a9629f1f18b6c9948362f55a3ae27
tree434e06618740feb480dd4ef48e523825b4f8cf82
parentfbac791aea04553de6efa02e78a9724d85cccb88
poll-loop: Track the poll timeout as an absolute, not a relative time.

This is a necessary prerequisite for allowing time to be "fast forwarded"
in unit tests, to keep tests that depend on the passage of time from
running in real time.  Without this change, a code sequence like this:

poll_timer_wait(1000);
...fast forward time 5 seconds...
poll_block();

would still sleep for a second, because the poll_loop module would still
have a relative timeout of 1000 ms.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/poll-loop.c
lib/timeval.c
lib/timeval.h