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
/
timeval.c
diff --git
a/lib/timeval.c
b/lib/timeval.c
index
ef806e7
..
ebbdb98
100644
(file)
--- a/
lib/timeval.c
+++ b/
lib/timeval.c
@@
-31,6
+31,7
@@
#include "fatal-signal.h"
#include "hash.h"
#include "hmap.h"
#include "fatal-signal.h"
#include "hash.h"
#include "hmap.h"
+#include "ovs-rcu.h"
#include "ovs-thread.h"
#include "signals.h"
#include "seq.h"
#include "ovs-thread.h"
#include "signals.h"
#include "seq.h"
@@
-286,6
+287,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();
+ }
+
#ifndef _WIN32
retval = poll(pollfds, n_pollfds, time_left);
if (retval < 0) {
#ifndef _WIN32
retval = poll(pollfds, n_pollfds, time_left);
if (retval < 0) {
@@
-306,6
+313,10
@@
time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
}
#endif
}
#endif
+ if (time_left) {
+ ovsrcu_quiesce_end();
+ }
+
if (deadline <= time_msec()) {
#ifndef _WIN32
fatal_signal_handler(SIGALRM);
if (deadline <= time_msec()) {
#ifndef _WIN32
fatal_signal_handler(SIGALRM);