Changeset 6417 for code/trunk/src/libraries/core/TclThreadManager.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/TclThreadManager.cc
r5929 r6417 39 39 #include "util/Convert.h" 40 40 #include "util/Exception.h" 41 #include "util/StringUtils.h" 41 42 #include "CommandExecutor.h" 42 43 #include "ConsoleCommand.h" … … 122 123 @brief The "main loop" of the TclThreadManager. Creates new threads if needed and handles queries and queued commands for the main interpreter. 123 124 */ 124 void TclThreadManager:: update(const Clock& time)125 void TclThreadManager::preUpdate(const Clock& time) 125 126 { 126 127 // Get the bundle of the main interpreter (0) … … 252 253 void TclThreadManager::initialize(TclInterpreterBundle* bundle) 253 254 { 254 std::stringid_string = getConvertedValue<unsigned int, std::string>(bundle->id_);255 const std::string& id_string = getConvertedValue<unsigned int, std::string>(bundle->id_); 255 256 256 257 // Initialize the new interpreter … … 403 404 { 404 405 // This query would lead to a deadlock - return with an error 405 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + " "+ getConvertedValue<unsigned int, std::string>(source_bundle->id_) \406 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + getConvertedValue<unsigned int, std::string>(source_bundle->id_) \ 406 407 + " -> " + getConvertedValue<unsigned int, std::string>(target_bundle->id_) \ 407 408 + "), couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(target_bundle->id_) \ 408 + " from other interpreter with ID " + getConvertedValue<unsigned int, std::string>(source_bundle->id_) + ".");409 + " from other interpreter with ID " + getConvertedValue<unsigned int, std::string>(source_bundle->id_) + '.'); 409 410 } 410 411 else … … 524 525 std::string TclThreadManager::dumpList(const std::list<unsigned int>& list) 525 526 { 526 std::string output = "";527 std::string output; 527 528 for (std::list<unsigned int>::const_iterator it = list.begin(); it != list.end(); ++it) 528 529 { 529 530 if (it != list.begin()) 530 output += " ";531 output += ' '; 531 532 532 533 output += getConvertedValue<unsigned int, std::string>(*it); … … 600 601 @param command the Command to execute 601 602 */ 602 void tclThread(TclInterpreterBundle* bundle, std::stringcommand)603 void tclThread(TclInterpreterBundle* bundle, const std::string& command) 603 604 { 604 605 TclThreadManager::debug("TclThread_execute: " + command); … … 613 614 @param file The name of the file that should be executed by the non-interactive interpreter. 614 615 */ 615 void sourceThread( std::stringfile)616 void sourceThread(const std::string& file) 616 617 { 617 618 TclThreadManager::debug("TclThread_source: " + file); … … 651 652 652 653 // Initialize the non-interactive interpreter (like in @ref TclBind::createTclInterpreter but exception safe) 653 std::stringlibpath = TclBind::getTclLibraryPath();654 if ( libpath != "")655 TclThreadManager::eval(bundle, "set tcl_library \"" + libpath + "\"", "source");654 const std::string& libpath = TclBind::getTclLibraryPath(); 655 if (!libpath.empty()) 656 TclThreadManager::eval(bundle, "set tcl_library \"" + libpath + '"', "source"); 656 657 int cc = Tcl_Init(interp); 657 658 TclThreadManager::eval(bundle, "source \"" + TclBind::getInstance().getTclDataPath() + "/init.tcl\"", "source");
Note: See TracChangeset
for help on using the changeset viewer.