Skip to content
Snippets Groups Projects
Commit fc1c5e3c authored by Raquel Alvarez Banos's avatar Raquel Alvarez Banos
Browse files

Merge branch '14010_ParameterEstimator_is_not_thread_safe' into...

Merge branch '14010_ParameterEstimator_is_not_thread_safe' into 13952_Fix_period_subtraction_in_MuonCalculateAsymmetry
parents 3d3141f1 ca77e06d
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
#include "MantidKernel/Logger.h"
#include <Poco/Timer.h>
#include <Poco/Mutex.h>
#include <cmath>
......@@ -20,8 +20,10 @@ using namespace Functions;
/// The logger.
Kernel::Logger g_log("ParameterEstimator");
namespace {
/// Mutex to prevent simultaneous access to functionMap
static Poco::Mutex mutex;
Poco::Mutex FUNCTION_MAP_MUTEX;
}
enum Function { None, Gaussian, Lorentzian, BackToBackExponential };
typedef std::map<std::string, std::pair<size_t, Function>> FunctionMapType;
......@@ -43,7 +45,7 @@ void initFunctionLookup(FunctionMapType &functionMapType) {
/// @returns :: a const reference to the functionMapType
const FunctionMapType &getFunctionMapType() {
Poco::Mutex::ScopedLock lock(mutex);
Poco::Mutex::ScopedLock lock(FUNCTION_MAP_MUTEX);
static FunctionMapType functionMapType;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment