Fixed issue 506 - plus some quite major refactoring

This commit is contained in:
Nick Bolton 2010-06-05 14:20:19 +00:00
parent a19e800b99
commit 24765e6891
8 changed files with 50 additions and 60 deletions

View file

@ -200,21 +200,8 @@ mainLoopStatic()
int
CArchAppUtilWindows::daemonNTMainLoop(int argc, const char** argv)
{
app().parseArgs(argc, argv);
if (app().argsBase().m_debugServiceWait)
{
while(true)
{
// this code is only executed when the process is launched via the
// windows service controller (and --debug-service-wait arg is
// used). to debug, set a breakpoint on this line so that
// execution is delayed until the debugger is attached.
ARCH->sleep(1);
LOG((CLOG_INFO "waiting for debugger to attach"));
}
}
app().initialize(argc, argv);
debugServiceWait();
app().argsBase().m_backend = false;
app().loadConfig();
return CArchMiscWindows::runDaemon(mainLoopStatic);
@ -301,3 +288,20 @@ CArchAppUtilWindows::instance()
{
return (CArchAppUtilWindows&)CArchAppUtil::instance();
}
void
CArchAppUtilWindows::debugServiceWait()
{
if (app().argsBase().m_debugServiceWait)
{
while(true)
{
// this code is only executed when the process is launched via the
// windows service controller (and --debug-service-wait arg is
// used). to debug, set a breakpoint on this line so that
// execution is delayed until the debugger is attached.
ARCH->sleep(1);
LOG((CLOG_INFO "waiting for debugger to attach"));
}
}
}