Skip to content

Commit

Permalink
Change the pacing of the logforward thread
Browse files Browse the repository at this point in the history
It seems that the old pacing method wasn't doing quite what I wanted, and maybe
the queue was getting backed up under stress.  Let's see if we can't make it
a bit better.
  • Loading branch information
Beirdo committed Jun 17, 2012
1 parent 32d0756 commit f48c4bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mythtv/libs/libmythbase/loggingserver.cpp
Expand Up @@ -1005,13 +1005,19 @@ void LogForwardThread::run(void)
}

int processed = 0;
while (!logMsgList.isEmpty() && processed < 100)
while (!logMsgList.isEmpty())
{
processed++;
LogMessage *msg = logMsgList.takeFirst();
lock.unlock();
forwardMessage(msg);
delete msg;

// Force a processEvents every 128 messages so a busy queue
// doesn't preclude timer notifications, etc.
if (processed & 127 == 0)
qApp->processEvents(QEventLoop::AllEvents, 10);

lock.relock();
}
}
Expand Down

0 comments on commit f48c4bc

Please sign in to comment.