From 4c3528e704facca29ed84f8e8445c78161d969e2 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Thu, 2 Apr 2015 20:01:40 +0300 Subject: [PATCH] minor fix; --- lib/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/queue.c b/lib/queue.c index 0762fb9..8ab08f9 100644 --- a/lib/queue.c +++ b/lib/queue.c @@ -272,7 +272,8 @@ static void *__poll_thread(void *poll) } if(resched) { /* ok now we need to resched and descrease/increase thread poll volume */ - mdrate = ((DQTPOLL_DELTASE*1000000) + DQTPOLL_DELTAMS)/p->msgop; + if(p->msgop) mdrate = ((DQTPOLL_DELTASE*1000000) + DQTPOLL_DELTAMS)/p->msgop; + else mdrate = 0; if((mdrate > p->poll_value) && (p->poll_value < MAX_POLL_VALUE)) { /* increase ! */ if((npoll = malloc(sizeof(struct __pthrd_data)))) { npoll->myid = idx_allocate(p->idx);