git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto-dpif: Use sequence number to wake up main thread for
[sliver-openvswitch.git]
/
lib
/
timer.h
diff --git
a/lib/timer.h
b/lib/timer.h
index
7302055
..
9afe3b7
100644
(file)
--- 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-20,14
+20,15
@@
#include <stdbool.h>
#include "timeval.h"
#include <stdbool.h>
#include "timeval.h"
+#include "util.h"
struct timer {
long long int t;
};
long long int timer_msecs_until_expired(const struct timer *);
struct timer {
long long int t;
};
long long int timer_msecs_until_expired(const struct timer *);
-
long long int timer_enabled_at(const struct timer *, long long int duration
);
-void timer_wait(const struct timer *);
+
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.
*
/* Causes 'timer' to expire when 'duration' milliseconds have passed.
*
@@
-56,18
+57,11
@@
timer_set_expired(struct timer *timer)
timer->t = LLONG_MIN;
}
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)
{
/* True if 'timer' has expired. */
static inline bool
timer_expired(const struct timer *timer)
{
- return time
r_expired_at(timer, time_msec())
;
+ return time
_msec() >= timer->t
;
}
/* Returns ture if 'timer' will never expire. */
}
/* Returns ture if 'timer' will never expire. */