made ipc log outputter message drop mechanism only drop messages from the buffer thread (*should* not cause deadlock, but feels a bit risky).
This commit is contained in:
parent
8bad45e8a2
commit
5be1fd0cfa
|
@ -89,7 +89,11 @@ CIpcLogOutputter::write(ELevel, const char* text, bool force)
|
|||
// would be difficult to distinguish (other than looking at the stack
|
||||
// trace somehow). perhaps a file stream might be a better option :-/
|
||||
if (m_sending && !force) {
|
||||
return true;
|
||||
|
||||
// ignore events from the buffer thread (would cause recursion).
|
||||
if (CThread::getCurrentThread().getID() == m_bufferThreadId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
appendBuffer(text);
|
||||
|
@ -107,6 +111,7 @@ CIpcLogOutputter::appendBuffer(const CString& text)
|
|||
void
|
||||
CIpcLogOutputter::bufferThread(void*)
|
||||
{
|
||||
m_bufferThreadId = m_bufferThread->getID();
|
||||
try {
|
||||
while (m_running) {
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "ILogOutputter.h"
|
||||
#include "CArch.h"
|
||||
#include <queue>
|
||||
#include "IArchMultithread.h"
|
||||
|
||||
class CIpcServer;
|
||||
class CEvent;
|
||||
|
@ -64,4 +65,6 @@ private:
|
|||
CArchCond m_notifyCond;
|
||||
CArchMutex m_notifyMutex;
|
||||
bool m_bufferWaiting;
|
||||
IArchMultithread::ThreadID
|
||||
m_bufferThreadId;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue