Permalink
Browse files

Change the pacing of the logforward thread

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...
1 parent 32d0756 commit f48c4bc2be1c7c36f34257a7daf5472fdf6e3769 @Beirdo Beirdo committed Jun 17, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 mythtv/libs/libmythbase/loggingserver.cpp
@@ -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();
}
}

0 comments on commit f48c4bc

Please sign in to comment.