]> git.proxmox.com Git - mirror_ovs.git/commitdiff
stopwatch: Add latch_poll to stopwatch loop.
authorMark Michelson <mmichels@redhat.com>
Wed, 11 Apr 2018 14:15:22 +0000 (09:15 -0500)
committerBen Pfaff <blp@ovn.org>
Fri, 13 Apr 2018 17:57:02 +0000 (10:57 -0700)
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@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/stopwatch.c

index bd40434afcda7b6425f753da5ed9ec1f77eda482..20e2eefc0445146a83e52e8a13d6c351866f1e18 100644 (file)
@@ -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) {