From 23a43262298667160afbfb01e5e8a4bab652103f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 4 Aug 2012 12:20:00 +0200 Subject: [PATCH] Added: #1440 Abort now possible while plugin is working --HG-- branch : build_pipeline_v3 --- .../service/module_pipeline_slave.cpp | 19 ++++++++++++++++++- .../service/pipeline_process_impl.cpp | 2 +- .../pipeline/service/pipeline_process_impl.h | 2 ++ .../pipeline_process_impl_buildinfo.cpp | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp index 746e77195..0400b8440 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -290,6 +290,12 @@ public: finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage); break; } + if (m_AbortRequested) + { + nlinfo("Aborted slave task after getting removed files"); + finalizeAbort(); + break; + } // Build the lists of files added changed removed buildListsOfFiles(); @@ -307,7 +313,15 @@ public: { m_SlaveTaskState = SOMEWHERE_INBETWEEN; CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_PLUGIN_WORKING); - finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage); + if (m_AbortRequested) + { + nlinfo("Aborted slave task while plugin was working"); + finalizeAbort(); + } + else + { + finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage); + } } break; default: @@ -645,6 +659,9 @@ public: CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_ABORTING); m_AbortRequested = true; + if (m_ActiveProcess) + m_ActiveProcess->m_Aborting = true; + // ?TODO? //m_ActiveProject = NULL; //m_ActiveProcess = NULL; diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl.cpp index e76cbb04a..3d3a94e85 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl.cpp @@ -46,7 +46,7 @@ using namespace std; namespace PIPELINE { -CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT) +CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT), m_Aborting(false) { if (activeProject == NULL) { diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl.h b/code/nel/tools/pipeline/service/pipeline_process_impl.h index 325eb790b..23adf8054 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl.h +++ b/code/nel/tools/pipeline/service/pipeline_process_impl.h @@ -103,6 +103,8 @@ private: std::set m_ListDependentDirectories; std::set m_ListDependentFiles; + + bool m_Aborting; private: bool getDependencyFileStatusCached(CFileStatus &fileStatus, const std::string &filePath); diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp index e7f80ff18..9623612b8 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp @@ -506,7 +506,7 @@ void CPipelineProcessImpl::setExit(const TProcessResult exitLevel, const std::st /// Must verify this regularly to exit the plugin in case something went wrong. bool CPipelineProcessImpl::needsExit() { - if (g_IsExiting) + if (g_IsExiting || m_Aborting) return true; // TODO: Bypass error feature.