From: Ben Pfaff Date: Sat, 28 Dec 2013 00:29:24 +0000 (-0800) Subject: ofproto-dpif-upcall: Slightly simplify udpif_upcall_handler(). X-Git-Tag: sliver-openvswitch-2.1.90-1~10^2~45 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=61057e884ca9c5bec9e2974acc91a3a2c1abdca6;p=sliver-openvswitch.git ofproto-dpif-upcall: Slightly simplify udpif_upcall_handler(). Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- 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 *