From 461449f1d14c03974f91550bd71b3dcae9bf12c9 Mon Sep 17 00:00:00 2001 From: sachiel Date: Fri, 29 Jun 2012 22:04:34 +0000 Subject: [PATCH] Let's not fall into an infinite loop with blocked requests git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@73061 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/evas_cserve2_requests.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/evas_cserve2_requests.c b/src/bin/evas_cserve2_requests.c index 4d1bda6..6908698 100644 --- a/src/bin/evas_cserve2_requests.c +++ b/src/bin/evas_cserve2_requests.c @@ -432,6 +432,8 @@ _cserve2_requests_process(void) Slave_Command ctype; unsigned int max_workers; Eina_List **idle, **working; + Eina_Inlist *itr; + Font_Request *req; for (j = 0; _request_match[j].rtype != CSERVE2_REQ_LAST; j++) { @@ -456,12 +458,12 @@ _cserve2_requests_process(void) idle = &_workers[type].idle; working = &_workers[type].working; - while (requests[rtype].waiting && - (eina_list_count(*working) < max_workers)) + EINA_INLIST_FOREACH_SAFE(requests[rtype].waiting, itr, req) { Slave_Worker *sw; - Font_Request *req = EINA_INLIST_CONTAINER_GET( - requests[rtype].waiting, Font_Request); + + if (eina_list_count(*working) >= max_workers) + break; if (req->locked) continue; -- 2.7.4