mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
more mutexes
This commit is contained in:
parent
4548841a93
commit
81a5d58d70
10 changed files with 127 additions and 7 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#include <QSocketNotifier>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QMutex>
|
||||
#include <QDateTime>
|
||||
#include <QThread>
|
||||
#ifdef Q_OS_UNIX
|
||||
|
|
@ -34,11 +33,11 @@ void ServerLogger::logMessage(QString message)
|
|||
if (!logFile)
|
||||
return;
|
||||
|
||||
static QMutex mutex;
|
||||
mutex.lock();
|
||||
logFileMutex.lock();
|
||||
QTextStream stream(logFile);
|
||||
stream << QDateTime::currentDateTime().toString() << " " << ((void *) QThread::currentThread()) << " " << message << "\n";
|
||||
mutex.unlock();
|
||||
stream.flush();
|
||||
logFileMutex.unlock();
|
||||
}
|
||||
|
||||
void ServerLogger::hupSignalHandler(int /*unused*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue