poll.c:poll_add_event_to_dcb didn't update pollStats.evq_pending when added event became pending. That may cause threads to run in poll loop with minimal timeout infinitely. Added counter update.

This commit is contained in:
VilhoRaatikka
2014-12-15 22:21:23 +02:00
parent 82407ceaf4
commit 8f570082eb

View File

@ -1329,7 +1329,6 @@ void poll_add_epollin_event_to_dcb(
} }
static void poll_add_event_to_dcb( static void poll_add_event_to_dcb(
DCB* dcb, DCB* dcb,
GWBUF* buf, GWBUF* buf,
@ -1345,6 +1344,10 @@ static void poll_add_event_to_dcb(
/** Set event to DCB */ /** Set event to DCB */
if (DCB_POLL_BUSY(dcb)) if (DCB_POLL_BUSY(dcb))
{ {
if (dcb->evq.pending_events == 0)
{
pollStats.evq_pending++;
}
dcb->evq.pending_events |= ev; dcb->evq.pending_events |= ev;
} }
else else
@ -1365,6 +1368,8 @@ static void poll_add_event_to_dcb(
dcb->evq.next = dcb; dcb->evq.next = dcb;
} }
pollStats.evq_length++; pollStats.evq_length++;
pollStats.evq_pending++;
if (pollStats.evq_length > pollStats.evq_max) if (pollStats.evq_length > pollStats.evq_max)
{ {
pollStats.evq_max = pollStats.evq_length; pollStats.evq_max = pollStats.evq_length;