[Orxonox-commit 734] r3264 - branches/netp6/src/core

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Jul 1 11:22:03 CEST 2009


Author: rgrieder
Date: 2009-07-01 11:22:03 +0200 (Wed, 01 Jul 2009)
New Revision: 3264

Modified:
   branches/netp6/src/core/CorePrecompiledHeaders.h
   branches/netp6/src/core/CorePrereqs.h
   branches/netp6/src/core/IRC.cc
   branches/netp6/src/core/IRC.h
   branches/netp6/src/core/TclThreadManager.cc
   branches/netp6/src/core/TclThreadManager.h
Log:
Moved boost headers from TclThreadmanager.h to the source file.
Also removed the old boost 1.34 commands since Oli requires 1.35 anyway and there have been about three or four new releases of boost since the writing of the code.

Modified: branches/netp6/src/core/CorePrecompiledHeaders.h
===================================================================
--- branches/netp6/src/core/CorePrecompiledHeaders.h	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/CorePrecompiledHeaders.h	2009-07-01 09:22:03 UTC (rev 3264)
@@ -59,8 +59,6 @@
 
 #include <boost/shared_ptr.hpp> // 12
 #include <boost/preprocessor/cat.hpp> // 12
-// Included by both filesystem and thread but still relatively small
-#include <boost/iterator/iterator_facade.hpp> // 10
 
 // Just in case some header included windows.h
 #undef min

Modified: branches/netp6/src/core/CorePrereqs.h
===================================================================
--- branches/netp6/src/core/CorePrereqs.h	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/CorePrereqs.h	2009-07-01 09:22:03 UTC (rev 3264)
@@ -149,7 +149,6 @@
     template <class T>
     class SubclassIdentifier;
     class TclBind;
-    struct TclInterpreterBundle;
     class TclThreadManager;
     class Template;
     class Tickable;
@@ -206,7 +205,7 @@
         struct path_traits;
         template <class String, class Traits> class basic_path;
         typedef basic_path<std::string, path_traits> path;
-    } 
+    }
     class thread;
     class mutex;
 }

Modified: branches/netp6/src/core/IRC.cc
===================================================================
--- branches/netp6/src/core/IRC.cc	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/IRC.cc	2009-07-01 09:22:03 UTC (rev 3264)
@@ -46,28 +46,28 @@
     IRC::IRC()
     {
         RegisterRootObject(IRC);
-        this->bundle_ = 0;
+        this->interpreter_ = 0;
     }
 
     void IRC::initialize()
     {
         unsigned int threadID = (unsigned int)IRC_TCL_THREADID;
         TclThreadManager::createID(threadID);
-        this->bundle_ = TclThreadManager::getInstance().getInterpreterBundle(threadID);
+        this->interpreter_ = TclThreadManager::getInstance().getTclInterpreter(threadID);
 
         try
         {
-            this->bundle_->interpreter_->def("orxonox::irc::say", IRC::tcl_say, Tcl::variadic());
-            this->bundle_->interpreter_->def("orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());
-            this->bundle_->interpreter_->def("orxonox::irc::action", IRC::tcl_action, Tcl::variadic());
-            this->bundle_->interpreter_->def("orxonox::irc::info", IRC::tcl_info, Tcl::variadic());
+            this->interpreter_->def("orxonox::irc::say", IRC::tcl_say, Tcl::variadic());
+            this->interpreter_->def("orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());
+            this->interpreter_->def("orxonox::irc::action", IRC::tcl_action, Tcl::variadic());
+            this->interpreter_->def("orxonox::irc::info", IRC::tcl_info, Tcl::variadic());
         }
         catch (Tcl::tcl_error const &e)
         {   COUT(1) << "Tcl (IRC) error: " << e.what();   }
         catch (std::exception const &e)
         {   COUT(1) << "Error while initializing Tcl (IRC): " << e.what();   }
 
-        this->nickname_ = "orx" + getConvertedValue<int, std::string>((unsigned int)rand());
+        this->nickname_ = "orx" + getConvertedValue<int, std::string>(static_cast<unsigned int>(rand()));
         TclThreadManager::execute(threadID, "set nickname " + this->nickname_);
         TclThreadManager::execute(threadID, "source irc.tcl");
     }
@@ -80,7 +80,7 @@
 
     bool IRC::eval(const std::string& command)
     {
-        if (!IRC::getInstance().bundle_)
+        if (!IRC::getInstance().interpreter_)
         {
             IRC::getInstance().initialize();
             COUT(1) << "Error: IRC client wasn't yet initialized, please try again." << std::endl;
@@ -89,7 +89,7 @@
 
         try
         {
-            IRC::getInstance().bundle_->interpreter_->eval(command);
+            IRC::getInstance().interpreter_->eval(command);
             return true;
         }
         catch (Tcl::tcl_error const &e)

Modified: branches/netp6/src/core/IRC.h
===================================================================
--- branches/netp6/src/core/IRC.h	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/IRC.h	2009-07-01 09:22:03 UTC (rev 3264)
@@ -58,7 +58,7 @@
             IRC(const IRC& other);
             ~IRC() {}
 
-            TclInterpreterBundle* bundle_;
+            Tcl::interpreter* interpreter_;
             std::string nickname_;
     };
 }

Modified: branches/netp6/src/core/TclThreadManager.cc
===================================================================
--- branches/netp6/src/core/TclThreadManager.cc	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/TclThreadManager.cc	2009-07-01 09:22:03 UTC (rev 3264)
@@ -29,6 +29,9 @@
 #include "TclThreadManager.h"
 
 #include <boost/bind.hpp>
+#include <boost/thread/condition.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/thread.hpp>
 #include <OgreTimer.h>
 #include <cpptcl/cpptcl.h>
 
@@ -55,6 +58,34 @@
     SetConsoleCommand(TclThreadManager, dump,    false).argumentCompleter(0, autocompletion::tclthreads());
     SetConsoleCommand(TclThreadManager, flush,   false).argumentCompleter(0, autocompletion::tclthreads());
 
+    struct TclInterpreterBundle
+    {
+        unsigned int id_;
+
+        std::list<std::string> queue_;
+        boost::mutex queueMutex_;
+
+        Tcl::interpreter* interpreter_;
+        std::string interpreterName_;
+        boost::try_mutex interpreterMutex_;
+
+        std::list<unsigned int> queriers_;
+        boost::mutex queriersMutex_;
+
+        bool running_;
+        boost::mutex runningMutex_;
+
+        bool finished_;
+        boost::mutex finishedMutex_;
+        boost::condition finishedCondition_;
+    };
+
+
+    static boost::thread::id threadID_g;
+    static boost::mutex bundlesMutex_g;
+    static boost::condition fullQueueCondition_g;
+    static boost::condition orxonoxEvalCondition_g;
+
     TclThreadManager* TclThreadManager::singletonRef_s = 0;
 
     TclThreadManager::TclThreadManager(Tcl::interpreter* interpreter)
@@ -65,20 +96,16 @@
         singletonRef_s = this;
 
         this->threadCounter_ = 0;
-        this->orxonoxInterpreterBundle_.id_ = 0;
-        this->orxonoxInterpreterBundle_.interpreter_ = interpreter;
-#if (BOOST_VERSION >= 103500)
-        this->threadID_ = boost::this_thread::get_id();
-#else
-        //
-#endif
+        this->orxonoxInterpreterBundle_->id_ = 0;
+        this->orxonoxInterpreterBundle_->interpreter_ = interpreter;
+        threadID_g = boost::this_thread::get_id();
     }
 
     TclThreadManager::~TclThreadManager()
     {
         unsigned int threadID;
         {
-            boost::mutex::scoped_lock bundles_lock(this->bundlesMutex_);
+            boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
             if (this->interpreterBundles_.begin() == this->interpreterBundles_.end())
                 return;
             else
@@ -91,7 +118,7 @@
 
     unsigned int TclThreadManager::create()
     {
-        boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
+        boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
         TclThreadManager::getInstance().threadCounter_++;
         std::string name = getConvertedValue<unsigned int, std::string>(TclThreadManager::getInstance().threadCounter_);
 
@@ -131,22 +158,14 @@
                     boost::mutex::scoped_lock finished_lock(bundle->finishedMutex_);
                     if (bundle->finished_)
                     {
-                        boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
-#if (BOOST_VERSION >= 103500)
+                        boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
                         boost::mutex::scoped_try_lock interpreter_lock(bundle->interpreterMutex_);
-#else
-                        boost::try_mutex::scoped_try_lock interpreter_lock(bundle->interpreterMutex_);
-#endif
                         try
                         {
                             while (!interpreter_lock.try_lock())
                             {
-                                TclThreadManager::getInstance().orxonoxEvalCondition_.notify_one();
-#if (BOOST_VERSION >= 103500)
+                                orxonoxEvalCondition_g.notify_one();
                                 boost::this_thread::yield();
-#else
-                                boost::thread::yield();
-#endif
                             }
                         } catch (...) {}
                         delete bundle->interpreter_;
@@ -156,12 +175,8 @@
                     }
                 }
 
-                TclThreadManager::getInstance().orxonoxEvalCondition_.notify_one();
-#if (BOOST_VERSION >= 103500)
+                orxonoxEvalCondition_g.notify_one();
                 boost::this_thread::yield();
-#else
-                boost::thread::yield();
-#endif
             }
 
             COUT(0) << "Destroyed Tcl-interpreter with ID " << threadID << std::endl;
@@ -180,7 +195,7 @@
 
     std::string TclThreadManager::query(unsigned int threadID, const std::string& command)
     {
-        return TclThreadManager::getInstance().evalQuery(TclThreadManager::getInstance().orxonoxInterpreterBundle_.id_, threadID, command);
+        return TclThreadManager::getInstance().evalQuery(TclThreadManager::getInstance().orxonoxInterpreterBundle_->id_, threadID, command);
     }
 
     void TclThreadManager::status()
@@ -190,14 +205,14 @@
         std::string output = "Orxonox";
         output += "\t\t";
         {
-            boost::mutex::scoped_lock queue_lock(TclThreadManager::getInstance().orxonoxInterpreterBundle_.queueMutex_);
-            output += getConvertedValue<unsigned int, std::string>(TclThreadManager::getInstance().orxonoxInterpreterBundle_.queue_.size());
+            boost::mutex::scoped_lock queue_lock(TclThreadManager::getInstance().orxonoxInterpreterBundle_->queueMutex_);
+            output += getConvertedValue<unsigned int, std::string>(TclThreadManager::getInstance().orxonoxInterpreterBundle_->queue_.size());
         }
         output += "\t\t";
         output += "busy";
         COUT(0) << output << std::endl;
 
-        boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
+        boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
         for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = TclThreadManager::getInstance().interpreterBundles_.begin(); it != TclThreadManager::getInstance().interpreterBundles_.end(); ++it)
         {
             std::string output = getConvertedValue<unsigned int, std::string>((*it).first);
@@ -208,11 +223,7 @@
             }
             output += "\t\t";
             {
-#if (BOOST_VERSION >= 103500)
                 boost::mutex::scoped_try_lock interpreter_lock((*it).second->interpreterMutex_);
-#else
-                boost::try_mutex::scoped_try_lock interpreter_lock((*it).second->interpreterMutex_);
-#endif
                 if (interpreter_lock.try_lock())
                     output += "ready";
                 else
@@ -227,7 +238,7 @@
         TclInterpreterBundle* bundle = 0;
         if (threadID == 0)
         {
-            bundle = &TclThreadManager::getInstance().orxonoxInterpreterBundle_;
+            bundle = TclThreadManager::getInstance().orxonoxInterpreterBundle_;
             COUT(0) << "Queue dump of Orxonox:" << std::endl;
         }
         else
@@ -253,7 +264,7 @@
     {
         TclInterpreterBundle* bundle = 0;
         if (threadID == 0)
-            bundle = &TclThreadManager::getInstance().orxonoxInterpreterBundle_;
+            bundle = TclThreadManager::getInstance().orxonoxInterpreterBundle_;
         else
             if (!(bundle = TclThreadManager::getInstance().getInterpreterBundle(threadID)))
                 return;
@@ -333,7 +344,7 @@
 
     TclInterpreterBundle* TclThreadManager::getInterpreterBundle(unsigned int threadID)
     {
-        boost::mutex::scoped_lock bundles_lock(this->bundlesMutex_);
+        boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
         std::map<unsigned int, TclInterpreterBundle*>::iterator it = this->interpreterBundles_.find(threadID);
         if (it != this->interpreterBundles_.end())
         {
@@ -346,6 +357,11 @@
         }
     }
 
+    Tcl::interpreter* TclThreadManager::getTclInterpreter(unsigned int threadID)
+    {
+        return this->getInterpreterBundle(threadID)->interpreter_;
+    }
+
     std::string TclThreadManager::dumpList(const std::list<unsigned int>& list)
     {
         std::string output = "";
@@ -361,20 +377,12 @@
 
     void TclThreadManager::error(const std::string& error)
     {
-#if (BOOST_VERSION >= 103500)
-        if (boost::this_thread::get_id() != this->threadID_)
-#else
-        if (boost::thread() != this->threadID_)
-#endif
+        if (boost::this_thread::get_id() != threadID_g)
         {
-            boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-            if (this->orxonoxInterpreterBundle_.queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
+            boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+            if (this->orxonoxInterpreterBundle_->queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
             {
-#if (BOOST_VERSION >= 103500)
                 boost::this_thread::yield();
-#else
-                boost::thread::yield();
-#endif
                 return;
             }
         }
@@ -384,20 +392,12 @@
 
     void TclThreadManager::debug(const std::string& error)
     {
-#if (BOOST_VERSION >= 103500)
-        if (boost::this_thread::get_id() != this->threadID_)
-#else
-        if (boost::thread() != this->threadID_)
-#endif
+        if (boost::this_thread::get_id() != threadID_g)
         {
-            boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-            if (this->orxonoxInterpreterBundle_.queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
+            boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+            if (this->orxonoxInterpreterBundle_->queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
             {
-#if (BOOST_VERSION >= 103500)
                 boost::this_thread::yield();
-#else
-                boost::thread::yield();
-#endif
                 return;
             }
         }
@@ -407,32 +407,32 @@
 
     void TclThreadManager::pushCommandToQueue(const std::string& command)
     {
-        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-        while (this->orxonoxInterpreterBundle_.queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
-            this->fullQueueCondition_.wait(queue_lock);
+        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+        while (this->orxonoxInterpreterBundle_->queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
+            fullQueueCondition_g.wait(queue_lock);
 
-        this->orxonoxInterpreterBundle_.queue_.push_back(command);
+        this->orxonoxInterpreterBundle_->queue_.push_back(command);
     }
 
     void TclThreadManager::forceCommandToFrontOfQueue(const std::string& command)
     {
-        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-        this->orxonoxInterpreterBundle_.queue_.push_front(command);
+        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+        this->orxonoxInterpreterBundle_->queue_.push_front(command);
     }
 
     std::string TclThreadManager::popCommandFromQueue()
     {
-        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-        std::string temp = this->orxonoxInterpreterBundle_.queue_.front();
-        this->orxonoxInterpreterBundle_.queue_.pop_front();
-        this->fullQueueCondition_.notify_one();
+        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+        std::string temp = this->orxonoxInterpreterBundle_->queue_.front();
+        this->orxonoxInterpreterBundle_->queue_.pop_front();
+        fullQueueCondition_g.notify_one();
         return temp;
     }
 
     bool TclThreadManager::queueIsEmpty()
     {
-        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_.queueMutex_);
-        return this->orxonoxInterpreterBundle_.queue_.empty();
+        boost::mutex::scoped_lock queue_lock(this->orxonoxInterpreterBundle_->queueMutex_);
+        return this->orxonoxInterpreterBundle_->queue_.empty();
     }
 
     void TclThreadManager::pushCommandToQueue(unsigned int threadID, const std::string& command)
@@ -504,14 +504,10 @@
         std::string output = "";
         if (querier)
         {
-            if (this->updateQueriersList(querier, &this->orxonoxInterpreterBundle_))
+            if (this->updateQueriersList(querier, this->orxonoxInterpreterBundle_))
             {
-#if (BOOST_VERSION >= 103500)
-                boost::mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
-#else
-                boost::try_mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
-#endif
-                this->orxonoxEvalCondition_.wait(interpreter_lock);
+                boost::mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_->interpreterMutex_);
+                orxonoxEvalCondition_g.wait(interpreter_lock);
 
                 if (!CommandExecutor::execute(command, false))
                     this->error("Error: Can't execute command \"" + command + "\"!");
@@ -520,8 +516,8 @@
                     output = CommandExecutor::getLastEvaluation().getReturnvalue().getString();
             }
 
-            boost::mutex::scoped_lock queriers_lock(this->orxonoxInterpreterBundle_.queriersMutex_);
-            this->orxonoxInterpreterBundle_.queriers_.clear();
+            boost::mutex::scoped_lock queriers_lock(this->orxonoxInterpreterBundle_->queriersMutex_);
+            this->orxonoxInterpreterBundle_->queriers_.clear();
         }
         return output;
     }
@@ -532,7 +528,7 @@
         if (threadID)
             target = this->getInterpreterBundle(threadID);
         else
-            target = &this->orxonoxInterpreterBundle_;
+            target = this->orxonoxInterpreterBundle_;
 
         std::string output = "";
         if (target)
@@ -541,17 +537,13 @@
             if (querierID)
                 querier = this->getInterpreterBundle(querierID);
             else
-                querier = &this->orxonoxInterpreterBundle_;
+                querier = this->orxonoxInterpreterBundle_;
 
             if (querier)
             {
                 if (this->updateQueriersList(querier, target))
                 {
-#if (BOOST_VERSION >= 103500)
                     boost::mutex::scoped_try_lock interpreter_lock(target->interpreterMutex_);
-#else
-                    boost::try_mutex::scoped_try_lock interpreter_lock(target->interpreterMutex_);
-#endif
                     bool successfullyLocked = false;
                     try
                     {
@@ -561,11 +553,7 @@
                         {
                             while (!interpreter_lock.try_lock())
                             {
-#if (BOOST_VERSION >= 103500)
                                 boost::this_thread::yield();
-#else
-                                boost::thread::yield();
-#endif
                             }
 
                             successfullyLocked = true;
@@ -598,16 +586,12 @@
     void TclThreadManager::update(const Clock& time)
     {
         {
-            this->orxonoxEvalCondition_.notify_one();
-#if (BOOST_VERSION >= 103500)
+            orxonoxEvalCondition_g.notify_one();
             boost::this_thread::yield();
-#else
-            boost::thread::yield();
-#endif
         }
 
         {
-            boost::mutex::scoped_lock bundles_lock(this->bundlesMutex_);
+            boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
             for (std::map<unsigned int, TclInterpreterBundle*>::iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
             {
                 boost::mutex::scoped_lock queue_lock((*it).second->queueMutex_);
@@ -625,11 +609,7 @@
         }
 
         {
-#if (BOOST_VERSION >= 103500)
-            boost::mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
-#else
-            boost::try_mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
-#endif
+            boost::mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_->interpreterMutex_);
             unsigned long maxtime = (unsigned long)(time.getDeltaTime() * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);
             Ogre::Timer timer;
             while (!this->queueIsEmpty())
@@ -643,7 +623,7 @@
 
     std::list<unsigned int> TclThreadManager::getThreadList() const
     {
-        boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
+        boost::mutex::scoped_lock bundles_lock(bundlesMutex_g);
         std::list<unsigned int> threads;
         for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
             threads.push_back((*it).first);
@@ -653,11 +633,7 @@
     void tclThread(TclInterpreterBundle* interpreterBundle, std::string command)
     {
         TclThreadManager::getInstance().debug("TclThread_execute: " + command);
-#if (BOOST_VERSION >= 103500)
         boost::mutex::scoped_lock interpreter_lock(interpreterBundle->interpreterMutex_);
-#else
-        boost::try_mutex::scoped_lock interpreter_lock(interpreterBundle->interpreterMutex_);
-#endif
         try
         {
             interpreterBundle->interpreter_->eval(command);

Modified: branches/netp6/src/core/TclThreadManager.h
===================================================================
--- branches/netp6/src/core/TclThreadManager.h	2009-07-01 08:51:57 UTC (rev 3263)
+++ branches/netp6/src/core/TclThreadManager.h	2009-07-01 09:22:03 UTC (rev 3264)
@@ -34,36 +34,13 @@
 #include <list>
 #include <map>
 #include <string>
-#include <boost/thread/condition.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
-
 #include "core/OrxonoxClass.h"
 
 namespace orxonox
 {
-    struct _CoreExport TclInterpreterBundle
-    {
-        unsigned int id_;
+    // Internal struct
+    struct TclInterpreterBundle;
 
-        std::list<std::string> queue_;
-        boost::mutex queueMutex_;
-
-        Tcl::interpreter* interpreter_;
-        std::string interpreterName_;
-        boost::try_mutex interpreterMutex_;
-
-        std::list<unsigned int> queriers_;
-        boost::mutex queriersMutex_;
-
-        bool running_;
-        boost::mutex runningMutex_;
-
-        bool finished_;
-        boost::mutex finishedMutex_;
-        boost::condition finishedCondition_;
-    };
-
     class _CoreExport TclThreadManager : public OrxonoxClass
     {
         friend class IRC;
@@ -100,6 +77,7 @@
             static bool tcl_running(int threadID);
 
             Tcl::interpreter* createNewTclInterpreter(const std::string& threadID);
+            Tcl::interpreter* getTclInterpreter(unsigned int threadID);
             TclInterpreterBundle* getInterpreterBundle(unsigned int threadID);
             std::string dumpList(const std::list<unsigned int>& list);
 
@@ -118,16 +96,8 @@
             std::string evalQuery(unsigned int querierID, unsigned int threadID, const std::string& command);
 
             unsigned int threadCounter_;
-            TclInterpreterBundle orxonoxInterpreterBundle_;
+            TclInterpreterBundle* orxonoxInterpreterBundle_;
             std::map<unsigned int, TclInterpreterBundle*> interpreterBundles_;
-            boost::mutex bundlesMutex_;
-            boost::condition fullQueueCondition_;
-            boost::condition orxonoxEvalCondition_;
-#if (BOOST_VERSION >= 103500)
-            boost::thread::id threadID_;
-#else
-            boost::thread threadID_;
-#endif
 
             static TclThreadManager* singletonRef_s;
     };




More information about the Orxonox-commit mailing list