Added: #1440 The build thread on the slave where the plugin will be called from

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent b09e65a178
commit d4a0a6df98

@ -59,6 +59,7 @@ namespace PIPELINE {
#define PIPELINE_INFO_STATUS_UPDATE_MASTER "S_ST_UPD_MASTER" #define PIPELINE_INFO_STATUS_UPDATE_MASTER "S_ST_UPD_MASTER"
#define PIPELINE_INFO_STATUS_UPDATE_SLAVE "S_ST_UPD_SLAVE" #define PIPELINE_INFO_STATUS_UPDATE_SLAVE "S_ST_UPD_SLAVE"
#define PIPELINE_INFO_GET_REMOVE "S_GET_REMOVE" #define PIPELINE_INFO_GET_REMOVE "S_GET_REMOVE"
#define PIPELINE_INFO_PLUGIN_WORKING "S_PLUGIN_WORKING"
#define PIPELINE_INFO_ABORTING "S_ABORTING" #define PIPELINE_INFO_ABORTING "S_ABORTING"
@ -93,7 +94,7 @@ public:
SOMEWHERE_INBETWEEN, SOMEWHERE_INBETWEEN,
STATUS_UPDATE, STATUS_UPDATE,
GET_REMOVE, GET_REMOVE,
// ... ACTUALLY_BUILDING,
}; };
TSlaveTaskState m_SlaveTaskState; // only set and used by update!! used on other threads for sanity checks TSlaveTaskState m_SlaveTaskState; // only set and used by update!! used on other threads for sanity checks
@ -110,8 +111,10 @@ public:
std::vector<std::string> m_DependentDirectories; std::vector<std::string> m_DependentDirectories;
std::vector<std::string> m_DependentFiles; std::vector<std::string> m_DependentFiles;
bool m_PluginBuildDone;
public: public:
CModulePipelineSlave() : m_Master(NULL), m_TestCommand(false), m_ReloadSheetsState(REQUEST_NONE), m_BuildReadyState(false), m_SlaveTaskState(IDLE_WAIT_MASTER), m_TaskManager(NULL), m_StatusUpdateMasterDone("StatusUpdateMasterDone"), m_StatusUpdateSlaveDone("StatusUpdateSlaveDone"), m_ActiveProject(NULL), m_ActiveProcess(NULL), m_AbortRequested(false) CModulePipelineSlave() : m_Master(NULL), m_TestCommand(false), m_ReloadSheetsState(REQUEST_NONE), m_BuildReadyState(false), m_SlaveTaskState(IDLE_WAIT_MASTER), m_TaskManager(NULL), m_StatusUpdateMasterDone("StatusUpdateMasterDone"), m_StatusUpdateSlaveDone("StatusUpdateSlaveDone"), m_ActiveProject(NULL), m_ActiveProcess(NULL), m_AbortRequested(false), m_PluginBuildDone(false)
{ {
NLMISC::CSynchronized<bool>::CAccessor(&m_StatusUpdateMasterDone).value() = false; NLMISC::CSynchronized<bool>::CAccessor(&m_StatusUpdateMasterDone).value() = false;
NLMISC::CSynchronized<bool>::CAccessor(&m_StatusUpdateSlaveDone).value() = false; NLMISC::CSynchronized<bool>::CAccessor(&m_StatusUpdateSlaveDone).value() = false;
@ -298,6 +301,14 @@ public:
} }
} }
break; break;
case ACTUALLY_BUILDING:
if (m_PluginBuildDone)
{
m_SlaveTaskState = SOMEWHERE_INBETWEEN;
CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_PLUGIN_WORKING);
finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage);
}
break;
default: default:
finishedTask(FINISH_ERROR, "Task got lost somewhere inbetween the code of the slave service. This is a programming error. Implementation may be incomplete."); finishedTask(FINISH_ERROR, "Task got lost somewhere inbetween the code of the slave service. This is a programming error. Implementation may be incomplete.");
break; break;
@ -396,10 +407,10 @@ public:
void beginGetRemove() void beginGetRemove()
{ {
m_RemovedTaskDone = false;
m_SlaveTaskState = GET_REMOVE; m_SlaveTaskState = GET_REMOVE;
m_ActiveProcess->m_SubTaskResult = FINISH_NOT; m_ActiveProcess->m_SubTaskResult = FINISH_NOT;
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_GET_REMOVE); CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_GET_REMOVE);
m_RemovedTaskDone = false;
m_TaskManager->addTask(new CGetRemovedTask(this)); m_TaskManager->addTask(new CGetRemovedTask(this));
} }
@ -499,9 +510,33 @@ public:
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
class CPluginBuildTask : public IRunnable
{
public:
CPluginBuildTask(CModulePipelineSlave *slave) : m_Slave(slave) { }
virtual void run()
{
// Figure out the build plugin
// ...
// Build
// ...
// TODO ************/////////////////########################################################################### BUILD THING
// Done
m_Slave->m_PluginBuildDone = true;
delete this;
}
private:
CModulePipelineSlave *m_Slave;
};
void beginTheBuildThing() void beginTheBuildThing()
{ {
// TODO ************/////////////////########################################################################### BUILD THING m_PluginBuildDone = false;
m_SlaveTaskState = ACTUALLY_BUILDING;
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_PLUGIN_WORKING);
m_TaskManager->addTask(new CPluginBuildTask(this));
} }
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////

Loading…
Cancel
Save