From 2183dbcc2876fd94a8a266a27f7b1e5b47bb6145 Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Thu, 25 Sep 2014 12:00:19 +0100 Subject: [PATCH] Performance improvement --- server/core/poll.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/core/poll.c b/server/core/poll.c index 527e147dc..47564dc22 100644 --- a/server/core/poll.c +++ b/server/core/poll.c @@ -479,7 +479,7 @@ DCB *zombies = NULL; * and leave it in the queue. * If the DCB was not already in the queue then it was * idle and is added to the queue to process after - * setting the eent bits. + * setting the event bits. */ for (i = 0; i < nfds; i++) { @@ -517,11 +517,17 @@ DCB *zombies = NULL; } } - if (thread_data) + /* + * If there was nothing to process then process the zombie queue + */ + if (process_pollq(thread_id) == 0) { - thread_data[thread_id].state = THREAD_ZPROCESSING; + if (thread_data) + { + thread_data[thread_id].state = THREAD_ZPROCESSING; + } + zombies = dcb_process_zombies(thread_id); } - zombies = dcb_process_zombies(thread_id); if (do_shutdown) {