the use of thread in optimisation, differential_equations and signal_processing removed 08/17008/2
Cedric Delamarre [Fri, 7 Aug 2015 12:48:25 +0000 (14:48 +0200)]
test_run optimization

Change-Id: Iddfc33063aaaba0e187d2a5da800aa56e64e8544

scilab/modules/differential_equations/includes/differentialequationfunctions.hxx
scilab/modules/differential_equations/src/cpp/differentialequationfunctions.cpp
scilab/modules/optimization/includes/optimizationfunctions.hxx
scilab/modules/optimization/src/cpp/optimizationfunctions.cpp
scilab/modules/signal_processing/src/cpp/signalprocessingfunctions.cpp
scilab/modules/signal_processing/src/cpp/signalprocessingfunctions.hxx

index dcfa635..d347c6a 100644 (file)
@@ -309,7 +309,7 @@ class DIFFERENTIAL_EQUATIONS_IMPEXP DifferentialEquation
 {
     // differential equation functions
 private :
-    static std::map<__threadId, DifferentialEquationFunctions*> m_mapDifferentialEquationFunctions;
+    static DifferentialEquationFunctions* m_DifferentialEquationFunctions;
 
 public :
     static void addDifferentialEquationFunctions(DifferentialEquationFunctions* _deFunction);
index 6bb9b0f..2cb14b3 100644 (file)
@@ -32,24 +32,21 @@ extern "C"
 
 // need the current thread, not the last running thread.
 
-std::map<__threadId, DifferentialEquationFunctions*> DifferentialEquation::m_mapDifferentialEquationFunctions;
+DifferentialEquationFunctions* DifferentialEquation::m_DifferentialEquationFunctions;
 
 void DifferentialEquation::addDifferentialEquationFunctions(DifferentialEquationFunctions* _deFunction)
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapDifferentialEquationFunctions[pThread->getThreadId()] = _deFunction;
+    m_DifferentialEquationFunctions = _deFunction;
 }
 
 void DifferentialEquation::removeDifferentialEquationFunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapDifferentialEquationFunctions.erase(pThread->getThreadId());
+    m_DifferentialEquationFunctions = NULL;
 }
 
 DifferentialEquationFunctions* DifferentialEquation::getDifferentialEquationFunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    return m_mapDifferentialEquationFunctions[pThread->getThreadId()];
+    return m_DifferentialEquationFunctions;
 }
 
 
index 0fc0b59..9b7c9ac 100644 (file)
@@ -108,7 +108,7 @@ class OPTIMIZATION_IMPEXP Optimization
 {
     // differential equation functions
 private :
-    static std::map<__threadId, OptimizationFunctions*> m_mapOptimizationFunctions;
+    static OptimizationFunctions* m_OptimizationFunctions;
 
 public :
     static void addOptimizationFunctions(OptimizationFunctions* _opFunction);
index 7cf14df..a00de76 100644 (file)
@@ -27,25 +27,21 @@ extern "C"
 ** \{
 */
 
-// need the current thread, not the last running thread.
-std::map<__threadId, OptimizationFunctions*> Optimization::m_mapOptimizationFunctions;
+OptimizationFunctions* Optimization::m_OptimizationFunctions;
 
-void Optimization::addOptimizationFunctions(OptimizationFunctions* _deFunction)
+void Optimization::addOptimizationFunctions(OptimizationFunctions* _opFunction)
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapOptimizationFunctions[pThread->getThreadId()] = _deFunction;
+    m_OptimizationFunctions = _opFunction;
 }
 
 void Optimization::removeOptimizationFunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapOptimizationFunctions.erase(pThread->getThreadId());
+    m_OptimizationFunctions = NULL;
 }
 
 OptimizationFunctions* Optimization::getOptimizationFunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    return m_mapOptimizationFunctions[pThread->getThreadId()];
+    return m_OptimizationFunctions;
 }
 
 /*
index ba88c2b..8d21a11 100644 (file)
@@ -24,24 +24,21 @@ extern "C"
 
 /*--------------------------------------------------------------------------*/
 
-std::map<__threadId, Signalprocessingfunctions*> Signalprocessing::m_mapSignalprocessingfunctions;
+Signalprocessingfunctions* Signalprocessing::m_Signalprocessingfunctions;
 
 void Signalprocessing::addSignalprocessingfunctions(Signalprocessingfunctions* _spFunction)
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapSignalprocessingfunctions[pThread->getThreadId()] = _spFunction;
+    m_Signalprocessingfunctions = _spFunction;
 }
 
 void Signalprocessing::removeSignalprocessingfunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    m_mapSignalprocessingfunctions.erase(pThread->getThreadId());
+    m_Signalprocessingfunctions = NULL;
 }
 
 Signalprocessingfunctions* Signalprocessing::getSignalprocessingfunctions()
 {
-    types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
-    return m_mapSignalprocessingfunctions[pThread->getThreadId()];
+    return m_Signalprocessingfunctions;
 }
 
 Signalprocessingfunctions::Signalprocessingfunctions(std::wstring callerName)
index a7c09ef..da0b247 100644 (file)
@@ -91,7 +91,7 @@ class SIGNAL_PROCESSING_IMPEXP Signalprocessing
 {
     // differential equation functions
 private :
-    static std::map<__threadId, Signalprocessingfunctions*> m_mapSignalprocessingfunctions;
+    static Signalprocessingfunctions* m_Signalprocessingfunctions;
 
 public :
     static void addSignalprocessingfunctions(Signalprocessingfunctions* _spFunction);