Changeset 1247 for code/branches/console/src/core/TclThreadManager.h
- Timestamp:
- May 8, 2008, 1:46:05 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/TclThreadManager.h
r1230 r1247 45 45 struct TclThread 46 46 { 47 unsigned int threadID_; 47 48 Tcl::interpreter* interpreter_; 48 49 boost::thread* thread_; 49 boost::try_mutex* mutex_; 50 boost::mutex* evalMutex_; 51 boost::mutex* stateMutex_; 52 enum State 53 { 54 Ready, 55 Busy, 56 Finished, 57 Error 58 }* state_; 50 59 }; 51 60 … … 60 69 static void execute(unsigned int threadID, const std::string& command); 61 70 static std::string query(unsigned int threadID, const std::string& command); 71 static void status(); 72 static void dump(unsigned int threadID); 62 73 74 static std::string tcl_query(int id, Tcl::object const &args); 63 75 static void tcl_execute(Tcl::object const &args); 64 static std::string tcl_orxonox(Tcl::object const &args);65 76 66 77 Tcl::interpreter* createTclInterpreter(unsigned int threadID) const; 67 78 bool createTclThread(); 68 79 bool destroyTclThread(unsigned int threadID); 80 81 void setState(TclThread* tclThread, TclThread::State state); 82 TclThread::State getState(TclThread* tclThread); 69 83 70 84 void pushCommandBack(const std::string& command); … … 85 99 86 100 bool isReady_; 101 bool isQuerying_; 102 unsigned int queryID_; 87 103 88 104 unsigned int IDcount_; 89 std::map<unsigned int, TclThread > threads_;90 std::map<unsigned int, std:: queue<std::string> > threadQueues_;105 std::map<unsigned int, TclThread*> threads_; 106 std::map<unsigned int, std::pair<std::queue<std::string>, boost::condition*> > threadQueues_; 91 107 std::queue<std::string> orxonoxQueue_; 92 108 93 boost::mutex orxonoxQueueMutex_; 94 boost::mutex threadQueuesMutex_; 95 boost::mutex threadsMutex_; 96 boost::mutex orxonoxEvalMutex_; 109 boost::try_mutex orxonoxQueueMutex_; 110 boost::try_mutex threadQueuesMutex_; 111 boost::try_mutex threadsMutex_; 112 boost::try_mutex orxonoxStateMutex_; 113 boost::try_mutex orxonoxQueryMutex_; 97 114 98 115 boost::condition orxonoxQueueCondition_; … … 100 117 }; 101 118 102 _CoreExport void tclThreadLoop(Tcl ::interpreter* interpreter, boost::try_mutex* mutex, unsigned int threadID);119 _CoreExport void tclThreadLoop(TclThread* tclThread); 103 120 } 104 121
Note: See TracChangeset
for help on using the changeset viewer.