remove threads information from configvariable 99/18699/4
Antoine ELIAS [Sun, 20 Nov 2016 09:32:41 +0000 (10:32 +0100)]
Change-Id: Ib47d71bf19a7f37db491533b5e6d53124c1649ef

scilab/modules/ast/includes/system_env/configvariable.hxx
scilab/modules/ast/src/cpp/system_env/configvariable.cpp
scilab/modules/functions/Makefile.am
scilab/modules/functions/Makefile.in
scilab/modules/functions/includes/functions_gw.hxx
scilab/modules/functions/sci_gateway/cpp/functions_gw.vcxproj
scilab/modules/functions/sci_gateway/cpp/functions_gw.vcxproj.filters
scilab/modules/functions/sci_gateway/cpp/sci_getCurrentThreadId.cpp [deleted file]
scilab/modules/functions/sci_gateway/cpp/sci_getThreads.cpp [deleted file]
scilab/modules/functions/sci_gateway/functions_gateway.xml

index 97b50b6..76a1c68 100644 (file)
@@ -32,7 +32,6 @@
 
 extern "C"
 {
-#include "Thread_Wrapper.h"
 #include "dynamiclibrary.h"
 #include "dynlib_ast.h"
 }
@@ -276,20 +275,6 @@ public :
     static bool togglePrintCompact(void);
 
 
-    //Thread List
-private :
-    static std::list<types::ThreadId*> m_threadList;
-public :
-
-    static types::ThreadId* getThread(__threadKey _key);
-    static types::ThreadId* getLastRunningThread();
-    static types::ThreadId* getLastPausedThread();
-    static types::ThreadId* getLastThread();
-
-    static types::Cell* getAllThreads(void);
-    static void addThread(types::ThreadId* _thread);
-    static void deleteThread(__threadKey _key);
-
     // Pause level
 private :
     static int m_iPauseLevel;
index 523d35a..6902a7c 100644 (file)
@@ -636,107 +636,6 @@ bool ConfigVariable::togglePrintCompact(void)
 
 
 /*
-** ThreadList
-** \{
-*/
-
-std::list<types::ThreadId *> ConfigVariable::m_threadList;
-
-types::ThreadId* ConfigVariable::getLastPausedThread()
-{
-    std::list<types::ThreadId *>::reverse_iterator it;
-    for (it = m_threadList.rbegin() ; it != m_threadList.rend() ; it++)
-    {
-        if ((*it)->getStatus() == types::ThreadId::Paused)
-        {
-            return *it;
-        }
-    }
-    return NULL;
-}
-
-types::ThreadId* ConfigVariable::getLastRunningThread()
-{
-    std::list<types::ThreadId *>::reverse_iterator it;
-    for (it = m_threadList.rbegin() ; it != m_threadList.rend() ; it++)
-    {
-        if ((*it)->getStatus() == types::ThreadId::Running)
-        {
-            return *it;
-        }
-    }
-    return NULL;
-}
-
-types::ThreadId* ConfigVariable::getLastThread()
-{
-    return m_threadList.back();
-}
-
-types::Cell* ConfigVariable::getAllThreads(void)
-{
-    int iSize = (int) ConfigVariable::m_threadList.size();
-
-    if (iSize == 0)
-    {
-        return new types::Cell();
-    }
-
-    int i = 0;
-    types::Cell *pcResult = new types::Cell(iSize, 1);
-    std::list<types::ThreadId *>::iterator it;
-
-    for (it = ConfigVariable::m_threadList.begin() ; it != ConfigVariable::m_threadList.end() ; ++it)
-    {
-        pcResult->set(i++, *it);
-    }
-
-    return pcResult;
-}
-
-
-void ConfigVariable::addThread(types::ThreadId* _thread)
-{
-    _thread->IncreaseRef();
-    m_threadList.push_back(_thread);
-}
-
-
-types::ThreadId* ConfigVariable::getThread(__threadKey _key)
-{
-    std::list<types::ThreadId *>::const_iterator it;
-
-    for (it = ConfigVariable::m_threadList.begin() ; it != ConfigVariable::m_threadList.end() ; ++it)
-    {
-        if ((*it)->getKey() == _key)
-        {
-            return *it;
-        }
-    }
-    return NULL;
-}
-
-
-void ConfigVariable::deleteThread(__threadKey _key)
-{
-    std::list<types::ThreadId *>::iterator it;
-    for (it = ConfigVariable::m_threadList.begin() ; it != ConfigVariable::m_threadList.end() ; ++it)
-    {
-        if ((*it)->getKey() == _key)
-        {
-            (*it)->DecreaseRef();
-            if ((*it)->isDeletable())
-            {
-                (*it)->killMe();
-                (*it) = NULL;
-                m_threadList.erase(it);
-                return;
-            }
-        }
-    }
-}
-
-/*
 ** \}
 */
 
index ab2031b..30de024 100644 (file)
@@ -8,14 +8,12 @@ GATEWAY_CPP_SOURCES =  \
     sci_gateway/cpp/sci_functionlist.cpp \
     sci_gateway/cpp/sci_whereis.cpp \
     sci_gateway/cpp/sci_execstr.cpp \
-    sci_gateway/cpp/sci_getCurrentThreadId.cpp \
-    sci_gateway/cpp/sci_getThreads.cpp \
     sci_gateway/cpp/sci_macrovar.cpp \
     sci_gateway/cpp/sci_libraryinfo.cpp \
     sci_gateway/cpp/sci_librarieslist.cpp \
     sci_gateway/cpp/sci_testGVN.cpp \
     sci_gateway/cpp/sci_testAnalysis.cpp
-    
+
 
 libscifunctions_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
index f7fae14..c70b3ab 100644 (file)
@@ -179,8 +179,6 @@ am__objects_1 = sci_gateway/cpp/libscifunctions_la-sci_exec.lo \
        sci_gateway/cpp/libscifunctions_la-sci_functionlist.lo \
        sci_gateway/cpp/libscifunctions_la-sci_whereis.lo \
        sci_gateway/cpp/libscifunctions_la-sci_execstr.lo \
-       sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo \
-       sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo \
        sci_gateway/cpp/libscifunctions_la-sci_macrovar.lo \
        sci_gateway/cpp/libscifunctions_la-sci_libraryinfo.lo \
        sci_gateway/cpp/libscifunctions_la-sci_librarieslist.lo \
@@ -551,8 +549,6 @@ GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_functionlist.cpp \
     sci_gateway/cpp/sci_whereis.cpp \
     sci_gateway/cpp/sci_execstr.cpp \
-    sci_gateway/cpp/sci_getCurrentThreadId.cpp \
-    sci_gateway/cpp/sci_getThreads.cpp \
     sci_gateway/cpp/sci_macrovar.cpp \
     sci_gateway/cpp/sci_libraryinfo.cpp \
     sci_gateway/cpp/sci_librarieslist.cpp \
@@ -766,12 +762,6 @@ sci_gateway/cpp/libscifunctions_la-sci_whereis.lo:  \
 sci_gateway/cpp/libscifunctions_la-sci_execstr.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo:  \
-       sci_gateway/cpp/$(am__dirstamp) \
-       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo:  \
-       sci_gateway/cpp/$(am__dirstamp) \
-       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libscifunctions_la-sci_macrovar.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -802,8 +792,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_exec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_execstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_functionlist.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getCurrentThreadId.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getThreads.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_librarieslist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_libraryinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_macrovar.Plo@am__quote@
@@ -863,20 +851,6 @@ sci_gateway/cpp/libscifunctions_la-sci_execstr.lo: sci_gateway/cpp/sci_execstr.c
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscifunctions_la-sci_execstr.lo `test -f 'sci_gateway/cpp/sci_execstr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_execstr.cpp
 
-sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo: sci_gateway/cpp/sci_getCurrentThreadId.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getCurrentThreadId.Tpo -c -o sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo `test -f 'sci_gateway/cpp/sci_getCurrentThreadId.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getCurrentThreadId.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getCurrentThreadId.Tpo sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getCurrentThreadId.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_getCurrentThreadId.cpp' object='sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscifunctions_la-sci_getCurrentThreadId.lo `test -f 'sci_gateway/cpp/sci_getCurrentThreadId.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getCurrentThreadId.cpp
-
-sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo: sci_gateway/cpp/sci_getThreads.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getThreads.Tpo -c -o sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo `test -f 'sci_gateway/cpp/sci_getThreads.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getThreads.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getThreads.Tpo sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_getThreads.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_getThreads.cpp' object='sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscifunctions_la-sci_getThreads.lo `test -f 'sci_gateway/cpp/sci_getThreads.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getThreads.cpp
-
 sci_gateway/cpp/libscifunctions_la-sci_macrovar.lo: sci_gateway/cpp/sci_macrovar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscifunctions_la-sci_macrovar.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_macrovar.Tpo -c -o sci_gateway/cpp/libscifunctions_la-sci_macrovar.lo `test -f 'sci_gateway/cpp/sci_macrovar.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_macrovar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_macrovar.Tpo sci_gateway/cpp/$(DEPDIR)/libscifunctions_la-sci_macrovar.Plo
index 11b91e2..ec209fb 100644 (file)
@@ -24,8 +24,6 @@ CPP_GATEWAY_PROTOTYPE_EXPORT(sci_exec, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_execstr, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_funclist, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_whereis, FUNCTIONS_GW_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_getCurrentThreadId, FUNCTIONS_GW_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_getThreads, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_macrovar, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_libraryinfo, FUNCTIONS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_librarieslist, FUNCTIONS_GW_IMPEXP);
index 4965320..b05fe04 100644 (file)
     </ClCompile>
     <ClCompile Include="sci_execstr.cpp" />
     <ClCompile Include="sci_functionlist.cpp" />
-    <ClCompile Include="sci_getCurrentThreadId.cpp" />
-    <ClCompile Include="sci_getThreads.cpp" />
     <ClCompile Include="sci_libraryinfo.cpp" />
     <ClCompile Include="sci_librarieslist.cpp" />
     <ClCompile Include="sci_macrovar.cpp" />
index 3345f32..b476a99 100644 (file)
     <ClCompile Include="sci_functionlist.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_getCurrentThreadId.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="sci_getThreads.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sci_whereis.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/scilab/modules/functions/sci_gateway/cpp/sci_getCurrentThreadId.cpp b/scilab/modules/functions/sci_gateway/cpp/sci_getCurrentThreadId.cpp
deleted file mode 100644 (file)
index b7f051a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-
-#include "functions_gw.hxx"
-#include "configvariable.hxx"
-#include "function.hxx"
-#include "threadId.hxx"
-
-extern "C"
-{
-#define NOMINMAX
-#include "Thread_Wrapper.h"
-#include "Scierror.h"
-#include "localization.h"
-}
-
-types::Function::ReturnValue sci_getCurrentThreadId(types::typed_list &in, int _iRetCount, types::typed_list &out)
-{
-    if (in.size() != 0)
-    {
-        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "getCurrentThreadId" , 0);
-        return types::Function::Error;
-    }
-
-    if (_iRetCount != 1)
-    {
-        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), "getCurrentThreadId" , 1);
-        return types::Function::Error;
-    }
-
-    out.push_back(ConfigVariable::getLastRunningThread());
-
-    return types::Function::OK;
-}
diff --git a/scilab/modules/functions/sci_gateway/cpp/sci_getThreads.cpp b/scilab/modules/functions/sci_gateway/cpp/sci_getThreads.cpp
deleted file mode 100644 (file)
index b696e5a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-
-#include "functions_gw.hxx"
-#include "configvariable.hxx"
-#include "function.hxx"
-#include "cell.hxx"
-
-extern "C"
-{
-#include "Scierror.h"
-#include "localization.h"
-}
-
-types::Function::ReturnValue sci_getThreads(types::typed_list &in, int _iRetCount, types::typed_list &out)
-{
-    if (in.size() != 0)
-    {
-        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "getThreads" , 0);
-        return types::Function::Error;
-    }
-
-    if (_iRetCount != 1)
-    {
-        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), "getThreads" , 1);
-        return types::Function::Error;
-    }
-
-    out.push_back(ConfigVariable::getAllThreads());
-
-    return types::Function::OK;
-}
index c9ea878..92d550e 100644 (file)
@@ -26,8 +26,6 @@
     <gateway name="sci_execstr"             function="execstr"              type="1" />
     <gateway name="sci_funclist"            function="funclist"             type="1" />
     <gateway name="sci_whereis"             function="whereis"              type="1" />
-    <gateway name="sci_getCurrentThreadId"  function="getCurrentThreadId"   type="1" />
-    <gateway name="sci_getThreads"          function="getThreads"           type="1" />
     <gateway name="sci_macrovar"            function="macrovar"             type="1" />
     <gateway name="sci_libraryinfo"         function="libraryinfo"          type="1" />
     <gateway name="sci_librarieslist"       function="librarieslist"        type="1" />