Merge pull request #61 from LordJZ/bug/world.log-race-condition

Eliminate race condition in World Log.
This commit is contained in:
Sergey 2012-07-30 19:30:17 -07:00
commit 2d7c2900c3
2 changed files with 3 additions and 0 deletions

View file

@ -717,6 +717,8 @@ void Log::outWorldPacketDump(uint32 socket, uint32 opcode, char const* opcodeNam
if (!worldLogfile)
return;
ACE_GUARD(ACE_Thread_Mutex, GuardObj, m_worldLogMtx);
outTimestamp(worldLogfile);
fprintf(worldLogfile, "\n%s:\nSOCKET: %u\nLENGTH: " SIZEFMTD "\nOPCODE: %s (0x%.4X)\nDATA:\n",

View file

@ -170,6 +170,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
FILE* charLogfile;
FILE* dberLogfile;
FILE* worldLogfile;
ACE_Thread_Mutex m_worldLogMtx;
// log/console control
LogLevel m_logLevel;