projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofp-util: New function for parsing key-value pairs.
[openvswitch]
/
lib
/
poll-loop.c
diff --git
a/lib/poll-loop.c
b/lib/poll-loop.c
index 4e192f3ae0eaaacd863ce545247cf698de322850..5ff70d9ff5d9c73ccf7d3098cad81616cf1978d3 100644
(file)
--- a/
lib/poll-loop.c
+++ b/
lib/poll-loop.c
@@
-55,9
+55,6
@@
struct poll_waiter {
/* All active poll waiters. */
static struct list waiters = LIST_INITIALIZER(&waiters);
/* All active poll waiters. */
static struct list waiters = LIST_INITIALIZER(&waiters);
-/* Number of elements in the waiters list. */
-static size_t n_waiters;
-
/* Max time to wait in next call to poll_block(), in milliseconds, or -1 to
* wait forever. */
static int timeout = -1;
/* Max time to wait in next call to poll_block(), in milliseconds, or -1 to
* wait forever. */
static int timeout = -1;
@@
-151,10
+148,10
@@
poll_immediate_wake(const char *where)
* arguments have two possible interpretations:
*
* - If 'pollfd' is nonnull then it should be the "struct pollfd" that caused
* arguments have two possible interpretations:
*
* - If 'pollfd' is nonnull then it should be the "struct pollfd" that caused
- * the wakeup.
In this case,
'timeout' is ignored.
+ * the wakeup. 'timeout' is ignored.
*
*
- * - If 'pollfd' is
nonnull then 'timeout' is the number of milliseconds
- *
after
which the poll loop woke up.
+ * - If 'pollfd' is
NULL then 'timeout' is the number of milliseconds after
+ * which the poll loop woke up.
*/
static void
log_wakeup(const char *where, const struct pollfd *pollfd, int timeout)
*/
static void
log_wakeup(const char *where, const struct pollfd *pollfd, int timeout)
@@
-217,13
+214,14
@@
poll_block(void)
static size_t max_pollfds;
struct poll_waiter *pw, *next;
static size_t max_pollfds;
struct poll_waiter *pw, *next;
- int n_pollfds;
+ int n_
waiters, n_
pollfds;
int retval;
/* Register fatal signal events before actually doing any real work for
* poll_block. */
fatal_signal_wait();
int retval;
/* Register fatal signal events before actually doing any real work for
* poll_block. */
fatal_signal_wait();
+ n_waiters = list_size(&waiters);
if (max_pollfds < n_waiters) {
max_pollfds = n_waiters;
pollfds = xrealloc(pollfds, max_pollfds * sizeof *pollfds);
if (max_pollfds < n_waiters) {
max_pollfds = n_waiters;
pollfds = xrealloc(pollfds, max_pollfds * sizeof *pollfds);
@@
-275,7
+273,6
@@
poll_cancel(struct poll_waiter *pw)
if (pw) {
list_remove(&pw->node);
free(pw);
if (pw) {
list_remove(&pw->node);
free(pw);
- n_waiters--;
}
}
\f
}
}
\f
@@
-289,6
+286,5
@@
new_waiter(int fd, short int events, const char *where)
waiter->events = events;
waiter->where = where;
list_push_back(&waiters, &waiter->node);
waiter->events = events;
waiter->where = where;
list_push_back(&waiters, &waiter->node);
- n_waiters++;
return waiter;
}
return waiter;
}