diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h index 12fa72f6b2fa5af13842c265c894e8ba0ce4a7ac..1de6f00cf34e9464f974acf47c2ebdaab710bc29 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h @@ -5,6 +5,8 @@ // Includes //---------------------------------------------------------------------- #include "MantidAPI/IDataFileChecker.h" +#include <Poco/Mutex.h> + #include <list> namespace Mantid @@ -104,6 +106,8 @@ namespace Mantid std::set<std::string> m_baseProps; /// The actual loader API::IDataFileChecker_sptr m_loader; + /// Mutex for temporary fix for #5963 + static Poco::Mutex m_mutex; }; } // namespace DataHandling diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp index 061d9ff66e9e722ea96962cdd994e74e9e013b0b..3deb40c59dd5f0890f739c6f491ed6d546d55953 100644 --- a/Code/Mantid/Framework/DataHandling/src/Load.cpp +++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp @@ -51,7 +51,6 @@ Load('event_ws', Filename='INSTR_1000_event.nxs',Precount=True) #include "MantidAPI/IMDEventWorkspace.h" #include <cstdio> - namespace { /** @@ -147,6 +146,9 @@ namespace Mantid // Register the algorithm into the algorithm factory DECLARE_ALGORITHM(Load); + // The mutex + Poco::Mutex Load::m_mutex; + /// Sets documentation strings for this algorithm void Load::initDocs() { @@ -273,6 +275,8 @@ namespace Mantid throw std::runtime_error("Error while closing file \"" + filePath + "\""); } + Poco::Mutex::ScopedLock lock( m_mutex ); + // Iterate through all loaders and attempt to find the best qualified for the job. // Each algorithm has a quick and long file check. The long version returns an integer // giving its certainty about be able to load the file. The highest wins.