From 61057e884ca9c5bec9e2974acc91a3a2c1abdca6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 27 Dec 2013 16:29:24 -0800 Subject: [PATCH] ofproto-dpif-upcall: Slightly simplify udpif_upcall_handler(). Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- ofproto/ofproto-dpif-upcall.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index d0de27c9d..47a3abfe2 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -625,17 +625,11 @@ udpif_upcall_handler(void *arg) handler->name = xasprintf("handler_%u", ovsthread_id_self()); set_subprogram_name("%s", handler->name); - for (;;) { + while (!latch_is_set(&handler->udpif->exit_latch)) { struct list misses = LIST_INITIALIZER(&misses); size_t i; ovs_mutex_lock(&handler->mutex); - - if (latch_is_set(&handler->udpif->exit_latch)) { - ovs_mutex_unlock(&handler->mutex); - return NULL; - } - if (!handler->n_upcalls) { ovs_mutex_cond_wait(&handler->wake_cond, &handler->mutex); } @@ -654,6 +648,8 @@ udpif_upcall_handler(void *arg) coverage_clear(); } + + return NULL; } static void * -- 2.43.0