|
|
@ -6,20 +6,20 @@
|
|
|
|
* CModulePipelineMaster
|
|
|
|
* CModulePipelineMaster
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 by authors
|
|
|
|
* Copyright (C) 2012 by authors
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This file is part of RYZOM CORE PIPELINE.
|
|
|
|
* This file is part of RYZOM CORE PIPELINE.
|
|
|
|
* RYZOM CORE PIPELINE is free software: you can redistribute it
|
|
|
|
* RYZOM CORE PIPELINE is free software: you can redistribute it
|
|
|
|
* and/or modify it under the terms of the GNU General Public License
|
|
|
|
* and/or modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation, either version 2 of
|
|
|
|
* as published by the Free Software Foundation, either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* RYZOM CORE PIPELINE is distributed in the hope that it will be
|
|
|
|
* RYZOM CORE PIPELINE is distributed in the hope that it will be
|
|
|
|
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with RYZOM CORE PIPELINE; see the file COPYING. If not, see
|
|
|
|
* along with RYZOM CORE PIPELINE; see the file COPYING. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
@ -72,15 +72,15 @@ namespace PIPELINE {
|
|
|
|
* CModulePipelineMaster
|
|
|
|
* CModulePipelineMaster
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class CModulePipelineMaster :
|
|
|
|
class CModulePipelineMaster :
|
|
|
|
public CModulePipelineMasterSkel,
|
|
|
|
public CModulePipelineMasterSkel,
|
|
|
|
public CEmptyModuleServiceBehav<CEmptyModuleCommBehav<CEmptySocketBehav<CModuleBase> > >
|
|
|
|
public CEmptyModuleServiceBehav<CEmptyModuleCommBehav<CEmptySocketBehav<CModuleBase> > >
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct CSlave
|
|
|
|
struct CSlave
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
CSlave(CModulePipelineMaster *master, IModuleProxy *moduleProxy)
|
|
|
|
CSlave(CModulePipelineMaster *master, IModuleProxy *moduleProxy)
|
|
|
|
: Master(master),
|
|
|
|
: Master(master),
|
|
|
|
Proxy(moduleProxy),
|
|
|
|
Proxy(moduleProxy),
|
|
|
|
ActiveTaskId(0),
|
|
|
|
ActiveTaskId(0),
|
|
|
|
SheetsOk(true),
|
|
|
|
SheetsOk(true),
|
|
|
|
SaneBehaviour(3),
|
|
|
|
SaneBehaviour(3),
|
|
|
@ -95,7 +95,7 @@ class CModulePipelineMaster :
|
|
|
|
sint SaneBehaviour;
|
|
|
|
sint SaneBehaviour;
|
|
|
|
uint BuildReadyState;
|
|
|
|
uint BuildReadyState;
|
|
|
|
uint32 TimeOutStamp;
|
|
|
|
uint32 TimeOutStamp;
|
|
|
|
|
|
|
|
|
|
|
|
~CSlave()
|
|
|
|
~CSlave()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!SheetsOk)
|
|
|
|
if (!SheetsOk)
|
|
|
@ -109,7 +109,7 @@ class CModulePipelineMaster :
|
|
|
|
return SheetsOk && (ActiveTaskId == 0) && SaneBehaviour > 0 && BuildReadyState == 2 && TimeOutStamp < NLMISC::CTime::getSecondsSince1970();
|
|
|
|
return SheetsOk && (ActiveTaskId == 0) && SaneBehaviour > 0 && BuildReadyState == 2 && TimeOutStamp < NLMISC::CTime::getSecondsSince1970();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
typedef std::map<IModuleProxy *, CSlave *> TSlaveMap;
|
|
|
|
typedef std::map<IModuleProxy *, CSlave *> TSlaveMap;
|
|
|
|
TSlaveMap m_Slaves;
|
|
|
|
TSlaveMap m_Slaves;
|
|
|
@ -120,7 +120,7 @@ protected:
|
|
|
|
bool m_AbortRequested;
|
|
|
|
bool m_AbortRequested;
|
|
|
|
|
|
|
|
|
|
|
|
NLMISC::CTaskManager *m_TaskManager; // Manages tasks requested by a slave.
|
|
|
|
NLMISC::CTaskManager *m_TaskManager; // Manages tasks requested by a slave.
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *>> m_WaitingCallbacks;
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *> > m_WaitingCallbacks;
|
|
|
|
|
|
|
|
|
|
|
|
// A runnable that's executed at next update state used as a callback.
|
|
|
|
// A runnable that's executed at next update state used as a callback.
|
|
|
|
// Override runnable as normal as the callback function.
|
|
|
|
// Override runnable as normal as the callback function.
|
|
|
@ -128,8 +128,8 @@ protected:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
CDelayedCallback(CModulePipelineMaster *master) : Master(master)
|
|
|
|
CDelayedCallback(CModulePipelineMaster *master) : Master(master)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *>>::CAccessor waitingCallbacks(&Master->m_WaitingCallbacks);
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *> >::CAccessor waitingCallbacks(&Master->m_WaitingCallbacks);
|
|
|
|
waitingCallbacks.value().push_back(this);
|
|
|
|
waitingCallbacks.value().push_back(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline CCallback<void> getCallback() { return CCallback<void>(this, &CDelayedCallback::callback); }
|
|
|
|
inline CCallback<void> getCallback() { return CCallback<void>(this, &CDelayedCallback::callback); }
|
|
|
@ -142,7 +142,7 @@ protected:
|
|
|
|
Master->addUpdateTask(this);
|
|
|
|
Master->addUpdateTask(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *>>::CAccessor waitingCallbacks(&Master->m_WaitingCallbacks);
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *> >::CAccessor waitingCallbacks(&Master->m_WaitingCallbacks);
|
|
|
|
waitingCallbacks.value().remove(this);
|
|
|
|
waitingCallbacks.value().remove(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -150,7 +150,7 @@ protected:
|
|
|
|
|
|
|
|
|
|
|
|
// Runnable tasks that are ran on the next update cycle.
|
|
|
|
// Runnable tasks that are ran on the next update cycle.
|
|
|
|
// The IRunnable instance is deleted by the update cycle.
|
|
|
|
// The IRunnable instance is deleted by the update cycle.
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *>> m_UpdateTasks;
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *> > m_UpdateTasks;
|
|
|
|
|
|
|
|
|
|
|
|
// build command
|
|
|
|
// build command
|
|
|
|
bool m_BypassErrors;
|
|
|
|
bool m_BypassErrors;
|
|
|
@ -181,11 +181,11 @@ public:
|
|
|
|
for (; ; )
|
|
|
|
for (; ; )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *>>::CAccessor waitingCallbacks(&m_WaitingCallbacks);
|
|
|
|
NLMISC::CSynchronized<std::list<IRunnable *> >::CAccessor waitingCallbacks(&m_WaitingCallbacks);
|
|
|
|
if (waitingCallbacks.value().size() == 0)
|
|
|
|
if (waitingCallbacks.value().size() == 0)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nlwarning("Waiting for callbacks on the master to be called...");
|
|
|
|
nlwarning("Waiting for callbacks on the master to be called...");
|
|
|
|
nlSleep(1000);
|
|
|
|
nlSleep(1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -194,11 +194,11 @@ public:
|
|
|
|
handleUpdateTasks();
|
|
|
|
handleUpdateTasks();
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
|
|
|
|
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
|
delete it->second;
|
|
|
|
delete it->second;
|
|
|
|
m_Slaves.clear();
|
|
|
|
m_Slaves.clear();
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
nldebug("END ~CModulePipelineMaster");
|
|
|
|
nldebug("END ~CModulePipelineMaster");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -242,7 +242,7 @@ public:
|
|
|
|
if (moduleProxy->getModuleClassName() == "ModulePipelineSlave")
|
|
|
|
if (moduleProxy->getModuleClassName() == "ModulePipelineSlave")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlinfo("Slave UP (%s)", moduleProxy->getModuleName().c_str());
|
|
|
|
nlinfo("Slave UP (%s)", moduleProxy->getModuleName().c_str());
|
|
|
|
|
|
|
|
|
|
|
|
nlassert(m_Slaves.find(moduleProxy) == m_Slaves.end());
|
|
|
|
nlassert(m_Slaves.find(moduleProxy) == m_Slaves.end());
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
if (m_AbortRequested)
|
|
|
|
if (m_AbortRequested)
|
|
|
@ -263,7 +263,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onModuleDown(IModuleProxy *moduleProxy)
|
|
|
|
virtual void onModuleDown(IModuleProxy *moduleProxy)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (moduleProxy->getModuleClassName() == "ModulePipelineSlave")
|
|
|
|
if (moduleProxy->getModuleClassName() == "ModulePipelineSlave")
|
|
|
@ -277,9 +277,9 @@ public:
|
|
|
|
m_ModuleUpDelay.erase(findDelay);
|
|
|
|
m_ModuleUpDelay.erase(findDelay);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else*/
|
|
|
|
else*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlassert(m_Slaves.find(moduleProxy) != m_Slaves.end());
|
|
|
|
nlassert(m_Slaves.find(moduleProxy) != m_Slaves.end());
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
|
|
|
|
|
|
|
|
TSlaveMap::iterator slaveIt = m_Slaves.find(moduleProxy);
|
|
|
|
TSlaveMap::iterator slaveIt = m_Slaves.find(moduleProxy);
|
|
|
@ -292,11 +292,11 @@ public:
|
|
|
|
// ... TODO ...
|
|
|
|
// ... TODO ...
|
|
|
|
slaveAbortedBuildTask(moduleProxy); // see if this works
|
|
|
|
slaveAbortedBuildTask(moduleProxy); // see if this works
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_Slaves.erase(slaveIt);
|
|
|
|
m_Slaves.erase(slaveIt);
|
|
|
|
delete slave;
|
|
|
|
delete slave;
|
|
|
|
// nldebug("Now %i slaves remaining", m_Slaves.size());
|
|
|
|
// nldebug("Now %i slaves remaining", m_Slaves.size());
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -310,7 +310,7 @@ public:
|
|
|
|
// The IRunnable will be deleted
|
|
|
|
// The IRunnable will be deleted
|
|
|
|
void addUpdateTask(IRunnable *runnable)
|
|
|
|
void addUpdateTask(IRunnable *runnable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *>>::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *> >::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
updateTasks.value().push_back(runnable);
|
|
|
|
updateTasks.value().push_back(runnable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -322,7 +322,7 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IRunnable *currentRunnable;
|
|
|
|
IRunnable *currentRunnable;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *>>::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *> >::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
if (updateTasks.value().size() == 0)
|
|
|
|
if (updateTasks.value().size() == 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
currentRunnable = updateTasks.value().front();
|
|
|
|
currentRunnable = updateTasks.value().front();
|
|
|
@ -331,7 +331,7 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
currentRunnable->run();
|
|
|
|
currentRunnable->run();
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *>>::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
NLMISC::CSynchronized<std::deque<IRunnable *> >::CAccessor updateTasks(&m_UpdateTasks);
|
|
|
|
updateTasks.value().pop_front();
|
|
|
|
updateTasks.value().pop_front();
|
|
|
|
if (updateTasks.value().size() == 0)
|
|
|
|
if (updateTasks.value().size() == 0)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -357,7 +357,7 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
it->second->BuildReadyState = 1;
|
|
|
|
it->second->BuildReadyState = 1;
|
|
|
|
it->second->Proxy.enterBuildReadyState(this);
|
|
|
|
it->second->Proxy.enterBuildReadyState(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// wait for confirmation, set BuildReadyState = 2 in that callback!
|
|
|
|
// wait for confirmation, set BuildReadyState = 2 in that callback!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
@ -393,9 +393,9 @@ public:
|
|
|
|
else if (nbWorking == 0)
|
|
|
|
else if (nbWorking == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// done (or stuck)
|
|
|
|
// done (or stuck)
|
|
|
|
|
|
|
|
|
|
|
|
m_BuildWorking = false;
|
|
|
|
m_BuildWorking = false;
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
// Iterate trough all slaves to tell them to end build_ready state.
|
|
|
|
// Iterate trough all slaves to tell them to end build_ready state.
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
@ -415,7 +415,7 @@ public:
|
|
|
|
for (std::vector<IModuleProxy *>::iterator it = m_ModuleUpDelay.begin(), end = m_ModuleUpDelay.end(); it != end; ++it)
|
|
|
|
for (std::vector<IModuleProxy *>::iterator it = m_ModuleUpDelay.begin(), end = m_ModuleUpDelay.end(); it != end; ++it)
|
|
|
|
onModuleUp(*it);*/
|
|
|
|
onModuleUp(*it);*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PIPELINE::endedBuildReadyMaster();
|
|
|
|
PIPELINE::endedBuildReadyMaster();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -447,7 +447,7 @@ public:
|
|
|
|
nlerror("Slave returned bad error level");
|
|
|
|
nlerror("Slave returned bad error level");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
notifyTerminalTaskState(slave->ActiveTaskId, (TProcessResult)errorLevel, errorMessage);
|
|
|
|
notifyTerminalTaskState(slave->ActiveTaskId, (TProcessResult)errorLevel, errorMessage);
|
|
|
|
|
|
|
|
|
|
|
|
slave->ActiveTaskId = 0;
|
|
|
|
slave->ActiveTaskId = 0;
|
|
|
@ -466,7 +466,7 @@ public:
|
|
|
|
notifyTerminalTaskState(slave->ActiveTaskId, FINISH_ABORT, "The task has been aborted");
|
|
|
|
notifyTerminalTaskState(slave->ActiveTaskId, FINISH_ABORT, "The task has been aborted");
|
|
|
|
slave->ActiveTaskId = 0;
|
|
|
|
slave->ActiveTaskId = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// in fact slaves are not allowed to refuse tasks, but they may do this if the user is toying around with the slave service
|
|
|
|
// in fact slaves are not allowed to refuse tasks, but they may do this if the user is toying around with the slave service
|
|
|
|
virtual void slaveRefusedBuildTask(NLNET::IModuleProxy *sender)
|
|
|
|
virtual void slaveRefusedBuildTask(NLNET::IModuleProxy *sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -494,7 +494,7 @@ public:
|
|
|
|
slave->SheetsOk = true;
|
|
|
|
slave->SheetsOk = true;
|
|
|
|
CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_MASTER_RELOAD_SHEETS);
|
|
|
|
CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_MASTER_RELOAD_SHEETS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void slaveBuildReadySuccess(NLNET::IModuleProxy *sender)
|
|
|
|
virtual void slaveBuildReadySuccess(NLNET::IModuleProxy *sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//m_SlavesMutex.lock();
|
|
|
|
//m_SlavesMutex.lock();
|
|
|
@ -504,7 +504,7 @@ public:
|
|
|
|
//m_SlavesMutex.unlock();
|
|
|
|
//m_SlavesMutex.unlock();
|
|
|
|
slave->BuildReadyState = 2;
|
|
|
|
slave->BuildReadyState = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void slaveBuildReadyFail(NLNET::IModuleProxy *sender)
|
|
|
|
virtual void slaveBuildReadyFail(NLNET::IModuleProxy *sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//m_SlavesMutex.lock();
|
|
|
|
//m_SlavesMutex.lock();
|
|
|
@ -546,7 +546,7 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
CUpdateDatabaseStatusSlaveCallback(CModulePipelineMaster *master, NLNET::IModuleProxy *slaveProxy) : CDelayedCallback(master), m_SlaveProxy(slaveProxy) { }
|
|
|
|
CUpdateDatabaseStatusSlaveCallback(CModulePipelineMaster *master, NLNET::IModuleProxy *slaveProxy) : CDelayedCallback(master), m_SlaveProxy(slaveProxy) { }
|
|
|
|
|
|
|
|
|
|
|
|
virtual void run() // this is sanely run from the update thread
|
|
|
|
virtual void run() // this is sanely run from the update thread
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Master->m_SlavesMutex.lock();
|
|
|
|
Master->m_SlavesMutex.lock();
|
|
|
@ -568,7 +568,7 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
delete this;
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
NLNET::IModuleProxy *m_SlaveProxy;
|
|
|
|
NLNET::IModuleProxy *m_SlaveProxy;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -576,8 +576,8 @@ public:
|
|
|
|
class CUpdateDatabaseStatusByVectorTask : public IRunnable
|
|
|
|
class CUpdateDatabaseStatusByVectorTask : public IRunnable
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
CUpdateDatabaseStatusByVectorTask(CModulePipelineMaster *master, NLNET::IModuleProxy *sender, std::vector<std::string> &slaveVector) : m_Master(master), m_Sender(sender)
|
|
|
|
CUpdateDatabaseStatusByVectorTask(CModulePipelineMaster *master, NLNET::IModuleProxy *sender, std::vector<std::string> &slaveVector) : m_Master(master), m_Sender(sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::swap(slaveVector, m_Vector);
|
|
|
|
std::swap(slaveVector, m_Vector);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
virtual void run() // run from the master process task manager
|
|
|
|
virtual void run() // run from the master process task manager
|
|
|
@ -592,7 +592,7 @@ public:
|
|
|
|
NLNET::IModuleProxy *m_Sender;
|
|
|
|
NLNET::IModuleProxy *m_Sender;
|
|
|
|
std::vector<std::string> m_Vector;
|
|
|
|
std::vector<std::string> m_Vector;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
virtual void updateDatabaseStatusByVector(NLNET::IModuleProxy *sender)
|
|
|
|
virtual void updateDatabaseStatusByVector(NLNET::IModuleProxy *sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// FIXME: THIS MUST BE DONE ON A SEPERATE THREAD, IT HANGS WHILE ITERATING
|
|
|
|
// FIXME: THIS MUST BE DONE ON A SEPERATE THREAD, IT HANGS WHILE ITERATING
|
|
|
@ -620,7 +620,7 @@ public:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ok)
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (g_IsExiting)
|
|
|
|
if (g_IsExiting)
|
|
|
@ -674,7 +674,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Yes, we effectively send the abort again to the slaves, it makes for a more epic abort button hammering experience.
|
|
|
|
// Yes, we effectively send the abort again to the slaves, it makes for a more epic abort button hammering experience.
|
|
|
|
|
|
|
|
|
|
|
|
m_BuildTaskQueue.abortQueue();
|
|
|
|
m_BuildTaskQueue.abortQueue();
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
m_SlavesMutex.lock();
|
|
|
@ -693,7 +693,7 @@ public:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
NLMISC_COMMAND_HANDLER_TABLE_EXTEND_BEGIN(CModulePipelineMaster, CModuleBase)
|
|
|
|
NLMISC_COMMAND_HANDLER_TABLE_EXTEND_BEGIN(CModulePipelineMaster, CModuleBase)
|
|
|
|
NLMISC_COMMAND_HANDLER_ADD(CModulePipelineMaster, reloadSheets, "Reload sheets across all services", "")
|
|
|
|
NLMISC_COMMAND_HANDLER_ADD(CModulePipelineMaster, reloadSheets, "Reload sheets across all services", "")
|
|
|
@ -717,11 +717,11 @@ protected:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void cbMasterSheetReloadUpdate()
|
|
|
|
void cbMasterSheetReloadUpdate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
m_SlavesMutex.lock();
|
|
|
|
|
|
|
|
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
|
for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CSlave *slave = it->second;
|
|
|
|
CSlave *slave = it->second;
|
|
|
@ -730,7 +730,7 @@ protected:
|
|
|
|
slave->Proxy.reloadSheets(this);
|
|
|
|
slave->Proxy.reloadSheets(this);
|
|
|
|
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_MASTER_RELOAD_SHEETS);
|
|
|
|
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_MASTER_RELOAD_SHEETS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
m_SlavesMutex.unlock();
|
|
|
|
|
|
|
|
|
|
|
|
PIPELINE::endedDirectTask();
|
|
|
|
PIPELINE::endedDirectTask();
|
|
|
|