Logging is causing a spinlock.. Needs further investigation

This commit is contained in:
Mark Watkins 2011-09-19 21:13:28 +10:00
parent d2a386143c
commit e1ed2311f3

View File

@ -32,11 +32,11 @@ QStatusBar *qstatusbar;
void MainWindow::Log(QString s) void MainWindow::Log(QString s)
{ {
// if (!loglock.tryLock()) {
// return;
// }
strlock.lock(); if (!strlock.tryLock())
return;
// strlock.lock();
QString tmp=QString("%1: %2").arg(logtime.elapsed(),5,10,QChar('0')).arg(s); QString tmp=QString("%1: %2").arg(logtime.elapsed(),5,10,QChar('0')).arg(s);
logbuffer.append(tmp); //QStringList appears not to be threadsafe logbuffer.append(tmp); //QStringList appears not to be threadsafe