|
@@ -95,7 +95,7 @@ void disableThorSlaveAsDaliClient()
|
|
|
|
|
|
class CJobListener : public CSimpleInterface
|
|
class CJobListener : public CSimpleInterface
|
|
{
|
|
{
|
|
- bool stopped;
|
|
|
|
|
|
+ bool &stopped;
|
|
CriticalSection crit;
|
|
CriticalSection crit;
|
|
OwningStringSuperHashTableOf<CJobSlave> jobs;
|
|
OwningStringSuperHashTableOf<CJobSlave> jobs;
|
|
CFifoFileCache querySoCache; // used to mirror master cache
|
|
CFifoFileCache querySoCache; // used to mirror master cache
|
|
@@ -158,7 +158,7 @@ class CJobListener : public CSimpleInterface
|
|
} excptHandler;
|
|
} excptHandler;
|
|
|
|
|
|
public:
|
|
public:
|
|
- CJobListener() : excptHandler(*this)
|
|
|
|
|
|
+ CJobListener(bool &_stopped) : stopped(_stopped), excptHandler(*this)
|
|
{
|
|
{
|
|
stopped = true;
|
|
stopped = true;
|
|
channelsPerSlave = globals->getPropInt("@channelsPerSlave", 1);
|
|
channelsPerSlave = globals->getPropInt("@channelsPerSlave", 1);
|
|
@@ -473,8 +473,15 @@ public:
|
|
}
|
|
}
|
|
case Shutdown:
|
|
case Shutdown:
|
|
{
|
|
{
|
|
- doReply = false;
|
|
|
|
stopped = true;
|
|
stopped = true;
|
|
|
|
+ PROGLOG("Shutdown received");
|
|
|
|
+ if (watchdog)
|
|
|
|
+ watchdog->stop();
|
|
|
|
+ mptag_t sdreplyTag;
|
|
|
|
+ deserializeMPtag(msg, sdreplyTag);
|
|
|
|
+ msg.setReplyTag(sdreplyTag);
|
|
|
|
+ msg.clear();
|
|
|
|
+ msg.append(false);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case GraphGetResult:
|
|
case GraphGetResult:
|
|
@@ -724,7 +731,7 @@ public:
|
|
virtual IFileInProgressHandler &queryFileInProgressHandler() { return *fipHandler.get(); }
|
|
virtual IFileInProgressHandler &queryFileInProgressHandler() { return *fipHandler.get(); }
|
|
};
|
|
};
|
|
|
|
|
|
-void slaveMain()
|
|
|
|
|
|
+void slaveMain(bool &jobListenerStopped)
|
|
{
|
|
{
|
|
unsigned masterMemMB = globals->getPropInt("@masterTotalMem");
|
|
unsigned masterMemMB = globals->getPropInt("@masterTotalMem");
|
|
HardwareInfo hdwInfo;
|
|
HardwareInfo hdwInfo;
|
|
@@ -742,7 +749,7 @@ void slaveMain()
|
|
}
|
|
}
|
|
roxiemem::setTotalMemoryLimit(gmemAllowHugePages, gmemAllowTransparentHugePages, gmemRetainMemory, ((memsize_t)gmemSize) * 0x100000, 0, thorAllocSizes, NULL);
|
|
roxiemem::setTotalMemoryLimit(gmemAllowHugePages, gmemAllowTransparentHugePages, gmemRetainMemory, ((memsize_t)gmemSize) * 0x100000, 0, thorAllocSizes, NULL);
|
|
|
|
|
|
- CJobListener jobListener;
|
|
|
|
|
|
+ CJobListener jobListener(jobListenerStopped);
|
|
CThorResourceSlave slaveResource;
|
|
CThorResourceSlave slaveResource;
|
|
setIThorResource(slaveResource);
|
|
setIThorResource(slaveResource);
|
|
|
|
|