[ovs-dev] [PATCH] stopwatch: Add latch_poll to stopwatch loop.

Mark Michelson mmichels at redhat.com
Wed Apr 11 14:15:22 UTC 2018


Nothing was clearing the latch, so the loop was busy. This makes it so
the loop only runs on new calls to latch_set() by a separate thread.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
---
 lib/stopwatch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/stopwatch.c b/lib/stopwatch.c
index bd40434af..20e2eefc0 100644
--- a/lib/stopwatch.c
+++ b/lib/stopwatch.c
@@ -429,6 +429,7 @@ stopwatch_thread(void *ign OVS_UNUSED)
         struct ovs_list command_list;
         struct stopwatch_packet *pkt;
 
+        latch_poll(&stopwatch_latch);
         guarded_list_pop_all(&stopwatch_commands, &command_list);
         ovs_mutex_lock(&stopwatches_lock);
         LIST_FOR_EACH_POP (pkt, list_node, &command_list) {
-- 
2.14.3



More information about the dev mailing list