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: Fix potential leak during flow mods.
[sliver-openvswitch.git]
/
lib
/
timeval.c
diff --git
a/lib/timeval.c
b/lib/timeval.c
index
ebbdb98
..
d2a4380
100644
(file)
--- a/
lib/timeval.c
+++ b/
lib/timeval.c
@@
-263,6
+263,7
@@
time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
{
long long int *last_wakeup = last_wakeup_get();
long long int start;
{
long long int *last_wakeup = last_wakeup_get();
long long int start;
+ bool quiescent;
int retval = 0;
time_init();
int retval = 0;
time_init();
@@
-274,6
+275,7
@@
time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
start = time_msec();
timeout_when = MIN(timeout_when, deadline);
start = time_msec();
timeout_when = MIN(timeout_when, deadline);
+ quiescent = ovsrcu_is_quiescent();
for (;;) {
long long int now = time_msec();
for (;;) {
long long int now = time_msec();
@@
-287,10
+289,12
@@
time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
time_left = timeout_when - now;
}
time_left = timeout_when - now;
}
- if (!time_left) {
- ovsrcu_quiesce();
- } else {
- ovsrcu_quiesce_start();
+ if (!quiescent) {
+ if (!time_left) {
+ ovsrcu_quiesce();
+ } else {
+ ovsrcu_quiesce_start();
+ }
}
#ifndef _WIN32
}
#ifndef _WIN32
@@
-313,7
+317,7
@@
time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
}
#endif
}
#endif
- if (time_left) {
+ if (
!quiescent &&
time_left) {
ovsrcu_quiesce_end();
}
ovsrcu_quiesce_end();
}