X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Ftimeval.c;h=d2a4380ff068c3535780cadae6729ed6f5511390;hb=0ef165ecb57943e17a8ee8270df68ffb8d032e29;hp=ebbdb98439c3026b38ca2fd63dc3222a89b14a25;hpb=0f2ea84841e1689ebf18e2260819e6493dbf2356;p=sliver-openvswitch.git diff --git a/lib/timeval.c b/lib/timeval.c index ebbdb9843..d2a4380ff 100644 --- 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; + bool quiescent; 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); + quiescent = ovsrcu_is_quiescent(); 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; } - if (!time_left) { - ovsrcu_quiesce(); - } else { - ovsrcu_quiesce_start(); + if (!quiescent) { + if (!time_left) { + ovsrcu_quiesce(); + } else { + ovsrcu_quiesce_start(); + } } #ifndef _WIN32 @@ -313,7 +317,7 @@ time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED, } #endif - if (time_left) { + if (!quiescent && time_left) { ovsrcu_quiesce_end(); }