mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
Merge pull request #61 from LordJZ/bug/world.log-race-condition
Eliminate race condition in World Log.
This commit is contained in:
commit
2d7c2900c3
2 changed files with 3 additions and 0 deletions
|
|
@ -717,6 +717,8 @@ void Log::outWorldPacketDump(uint32 socket, uint32 opcode, char const* opcodeNam
|
||||||
if (!worldLogfile)
|
if (!worldLogfile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ACE_GUARD(ACE_Thread_Mutex, GuardObj, m_worldLogMtx);
|
||||||
|
|
||||||
outTimestamp(worldLogfile);
|
outTimestamp(worldLogfile);
|
||||||
|
|
||||||
fprintf(worldLogfile, "\n%s:\nSOCKET: %u\nLENGTH: " SIZEFMTD "\nOPCODE: %s (0x%.4X)\nDATA:\n",
|
fprintf(worldLogfile, "\n%s:\nSOCKET: %u\nLENGTH: " SIZEFMTD "\nOPCODE: %s (0x%.4X)\nDATA:\n",
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
|
||||||
FILE* charLogfile;
|
FILE* charLogfile;
|
||||||
FILE* dberLogfile;
|
FILE* dberLogfile;
|
||||||
FILE* worldLogfile;
|
FILE* worldLogfile;
|
||||||
|
ACE_Thread_Mutex m_worldLogMtx;
|
||||||
|
|
||||||
// log/console control
|
// log/console control
|
||||||
LogLevel m_logLevel;
|
LogLevel m_logLevel;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue