- Timestamp:
- Sep 11, 2010, 12:34:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/doc (added) merged: 7290-7292,7296-7300,7302-7304,7306-7312,7315-7318,7323,7325,7327,7331-7332,7334-7335,7345-7347,7352-7353,7356-7357,7361,7363-7367,7371-7375,7388
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/command/TclThreadManager.cc
r7284 r7401 26 26 * 27 27 */ 28 29 /** 30 @file 31 @brief Implementation of TclThreadManager. 32 */ 28 33 29 34 #include "TclThreadManager.h" … … 251 256 void TclThreadManager::initialize(TclInterpreterBundle* bundle) 252 257 { 253 const std::string& id_string = getConvertedValue<unsigned int,std::string>(bundle->id_);258 const std::string& id_string = multi_cast<std::string>(bundle->id_); 254 259 255 260 // Initialize the new interpreter … … 303 308 /** 304 309 @brief Sends a command to the queue of a given Tcl-interpreter 305 @param id The id of the target interpreter310 @param target_id The id of the target interpreter 306 311 @param command The command to be sent 307 312 */ … … 326 331 @brief This function can be called from Tcl to send a command to the queue of any interpreter. 327 332 @param target_id The id of the target thread 333 @param args Contains the content of the command 328 334 */ 329 335 void TclThreadManager::tcl_crossexecute(int target_id, const Tcl::object& args) … … 334 340 /** 335 341 @brief Sends a command to the queue of a given Tcl-interpreter 336 @param id The id of the target interpreter342 @param target_id The id of the target interpreter 337 343 @param command The command to be sent 338 344 */ … … 347 353 /** 348 354 @brief Sends a query to a given Tcl-interpreter and waits for the result 349 @param id The id of the target interpreter355 @param target_id The id of the target interpreter 350 356 @param command The command to be sent 351 357 @return The result of the command … … 359 365 @brief This function can be called from Tcl to send a query to the main thread. 360 366 @param source_id The id of the calling thread 367 @param args Contains the content of the query 361 368 362 369 A query waits for the result of the command. This means, the calling thread will be blocked until … … 373 380 @param source_id The id of the calling thread 374 381 @param target_id The id of the target thread 382 @param args Contains the content of the query 375 383 */ 376 384 std::string TclThreadManager::tcl_crossquery(int source_id, int target_id, const Tcl::object& args) … … 384 392 @param target_id The id of the target thread 385 393 @param command The command to send as a query 386 @param bUseCommandExecutor Only used if the target_id is 0 (which references the main interpreter). In this case it means if the command should be passed to the CommandExecutor (true) or to the main Tcl interpreter (false). This is true when called by tcl_query and false when called by tcl_crossquery.394 @param bUseCommandExecutor Only used if the target_id is 0 (which references the main interpreter). In this case it means if the command should be passed to the CommandExecutor (true) or to the main Tcl interpreter (false). This is true when called by tcl_query() and false when called by tcl_crossquery(). 387 395 */ 388 396 std::string TclThreadManager::_query(unsigned int source_id, unsigned int target_id, const std::string& command, bool bUseCommandExecutor) … … 400 408 { 401 409 // This query would lead to a deadlock - return with an error 402 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + getConvertedValue<unsigned int,std::string>(source_bundle->id_) \403 + " -> " + getConvertedValue<unsigned int,std::string>(target_bundle->id_) \404 + "), couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int,std::string>(target_bundle->id_) \405 + " from other interpreter with ID " + getConvertedValue<unsigned int,std::string>(source_bundle->id_) + '.');410 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \ 411 + " -> " + multi_cast<std::string>(target_bundle->id_) \ 412 + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \ 413 + " from other interpreter with ID " + multi_cast<std::string>(source_bundle->id_) + '.'); 406 414 } 407 415 else … … 469 477 // This happens if the main thread tries to query a busy interpreter 470 478 // To avoid a lock of the main thread, we simply don't proceed with the query in this case 471 TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int,std::string>(target_bundle->id_) + ", interpreter is busy right now.");479 TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now."); 472 480 } 473 481 } … … 515 523 else 516 524 { 517 TclThreadManager::error("Error: No Tcl-interpreter with ID " + getConvertedValue<unsigned int,std::string>(id) + " existing.");525 TclThreadManager::error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing."); 518 526 return 0; 519 527 } … … 531 539 output += ' '; 532 540 533 output += getConvertedValue<unsigned int,std::string>(*it);541 output += multi_cast<std::string>(*it); 534 542 } 535 543 return output; … … 583 591 if (cc != TCL_OK) 584 592 { 585 TclThreadManager::error("Tcl error (" + action + ", ID " + getConvertedValue<unsigned int,std::string>(bundle->id_) + "): " + static_cast<std::string>(result));593 TclThreadManager::error("Tcl error (" + action + ", ID " + multi_cast<std::string>(bundle->id_) + "): " + static_cast<std::string>(result)); 586 594 return ""; 587 595 }
Note: See TracChangeset
for help on using the changeset viewer.