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);