2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

stopwatch: Add latch_poll to stopwatch loop.

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>
This commit is contained in:
Mark Michelson 2018-04-11 09:15:22 -05:00 committed by Ben Pfaff
parent 99cc5c921d
commit 0f3d9fb485

View File

@ -429,6 +429,7 @@ stopwatch_thread(void *ign OVS_UNUSED)
struct ovs_list command_list; struct ovs_list command_list;
struct stopwatch_packet *pkt; struct stopwatch_packet *pkt;
latch_poll(&stopwatch_latch);
guarded_list_pop_all(&stopwatch_commands, &command_list); guarded_list_pop_all(&stopwatch_commands, &command_list);
ovs_mutex_lock(&stopwatches_lock); ovs_mutex_lock(&stopwatches_lock);
LIST_FOR_EACH_POP (pkt, list_node, &command_list) { LIST_FOR_EACH_POP (pkt, list_node, &command_list) {