fixed: on windows xp daemon deadlocks and synergys crashes on startup. also fixed uninitialized ipc program args value (always turning ipc on). moved the event queue further up the stack for (client, server and daemon) so that it's always available (not just in the main loop).

This commit is contained in:
Nick Bolton 2012-07-14 00:15:07 +00:00
parent a62fee84cc
commit 4378e520f0
7 changed files with 14 additions and 14 deletions

View File

@ -73,8 +73,7 @@ CString
CArchPluginWindows::getModuleDir()
{
TCHAR c_modulePath[MAX_PATH];
GetModuleFileName(NULL, c_modulePath, MAX_PATH);
if (GetLastError() != ERROR_SUCCESS) {
if (GetModuleFileName(NULL, c_modulePath, MAX_PATH) == 0) {
throw XArch(new XArchEvalWindows);
}

View File

@ -111,7 +111,9 @@ CIpcLogOutputter::appendBuffer(const CString& text)
void
CIpcLogOutputter::bufferThread(void*)
{
CArchMutexLock lock(m_notifyMutex);
m_bufferThreadId = m_bufferThread->getID();
try {
while (m_running) {

View File

@ -29,6 +29,7 @@
#include "TMethodEventJob.h"
#include "CIpcMessage.h"
#include "Ipc.h"
#include "CEventQueue.h"
#if SYSAPI_WIN32
#include "CArchMiscWindows.h"
@ -252,6 +253,7 @@ CApp::run(int argc, char** argv)
arch.init();
CLog log;
CEventQueue events;
#if MAC_OS_X_VERSION_10_7
// dock hide only supported on lion :(

View File

@ -36,7 +36,8 @@ m_pname(NULL),
m_logFilter(NULL),
m_logFile(NULL),
m_display(NULL),
m_enableVnc(false)
m_enableVnc(false),
m_enableIpc(false)
{
}

View File

@ -526,9 +526,6 @@ CClientApp::mainLoop()
// on unix because threads evaporate across a fork().
CSocketMultiplexer multiplexer;
// create the event queue
CEventQueue eventQueue;
// start client, etc
appUtil().startNode();

View File

@ -101,6 +101,7 @@ CDaemonApp::run(int argc, char** argv)
arch.init();
CLog log;
CEventQueue events;
bool uninstall = false;
try
@ -187,12 +188,13 @@ CDaemonApp::mainLoop(bool logToFile)
try
{
DAEMON_RUNNING(true);
/*while (true)
{
}*/
if (logToFile)
CLOG->insert(new CFileLogOutputter(logPath().c_str()));
CEventQueue eventQueue;
// create socket multiplexer. this must happen after daemonization
// on unix because threads evaporate across a fork().
CSocketMultiplexer multiplexer;
@ -208,7 +210,7 @@ CDaemonApp::mainLoop(bool logToFile)
m_relauncher = new CMSWindowsRelauncher(false, *m_ipcServer, *m_ipcLogOutputter);
#endif
eventQueue.adoptHandler(
EVENTQUEUE->adoptHandler(
CIpcServer::getMessageReceivedEvent(), m_ipcServer,
new TMethodEventJob<CDaemonApp>(this, &CDaemonApp::handleIpcMessage));
@ -230,14 +232,14 @@ CDaemonApp::mainLoop(bool logToFile)
m_relauncher->startAsync();
#endif
eventQueue.loop();
EVENTQUEUE->loop();
#if SYSAPI_WIN32
m_relauncher->stop();
delete m_relauncher;
#endif
eventQueue.removeHandler(
EVENTQUEUE->removeHandler(
CIpcServer::getMessageReceivedEvent(), m_ipcServer);
CLOG->remove(m_ipcLogOutputter);

View File

@ -758,9 +758,6 @@ CServerApp::mainLoop()
// on unix because threads evaporate across a fork().
CSocketMultiplexer multiplexer;
// create the event queue
CEventQueue eventQueue;
// if configuration has no screens then add this system
// as the default
if (args().m_config->begin() == args().m_config->end()) {