X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Ftimer.h;h=9afe3b75e48d7d0d3938e24c87cfa78432cc79fa;hb=HEAD;hp=2197f934869073814705a3a7e9bd20b40362d231;hpb=b2fda3effc787f265b5ad5dfa967ac00627bd075;p=sliver-openvswitch.git diff --git a/lib/timer.h b/lib/timer.h index 2197f9348..9afe3b75e 100644 --- a/lib/timer.h +++ b/lib/timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Nicira Networks. + * Copyright (c) 2011, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,8 @@ struct timer { }; long long int timer_msecs_until_expired(const struct timer *); -void timer_wait(const struct timer *, const char *where); -#define timer_wait(timer) timer_wait(timer, SOURCE_LOCATOR) +void timer_wait_at(const struct timer *, const char *where); +#define timer_wait(timer) timer_wait_at(timer, SOURCE_LOCATOR) /* Causes 'timer' to expire when 'duration' milliseconds have passed. * @@ -57,18 +57,11 @@ timer_set_expired(struct timer *timer) timer->t = LLONG_MIN; } -/* True if 'timer' had (or will have) expired at 'time'. */ -static inline bool -timer_expired_at(const struct timer *timer, long long int time) -{ - return time >= timer->t; -} - /* True if 'timer' has expired. */ static inline bool timer_expired(const struct timer *timer) { - return timer_expired_at(timer, time_msec()); + return time_msec() >= timer->t; } /* Returns ture if 'timer' will never expire. */