Changeset 2956 in Sophya for trunk


Ignore:
Timestamp:
May 31, 2006, 2:30:13 PM (19 years ago)
Author:
ansari
Message:

correction gestion & pour ThrExec ds Commander - Reza 31/05/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/commander.cc

    r2955 r2956  
    368368  _cmdex = cmdex;
    369369  _keyw = keyw;
    370   if (args.size() > 1)
    371     for(size_t k=0; k<args.size()-1; k++) _args.push_back(args[k]);
     370  _args = args;
     371  _args.erase(_args.end()-1);
    372372  _toks = toks;
    373373  for(size_t k=_toks.size()-1; k>0; k--)
     
    19631963    if ((*it).second.cex) {
    19641964      // Doit-on l'executer sous forme de thread separe ?
    1965       if ( (args.size()>0) && (args[args.size()-1] == "&") &&
    1966            ((*it).second.cex->IsThreadable(keyw)) ) {
    1967         ThrId++;
    1968         CommandExeThr * thr = new CommandExeThr(ThrId, (*it).second.cex, keyw, args, toks);
    1969         CmdThrExeList.push_back(thr);
    1970         cout << " Commander::ExecuteCommand() : Thread execution of command " << keyw << endl;
    1971         thr->start();
    1972         if (CmdThrExeList.size() > 5)  CleanThrList();
    1973         rc = 0;
     1965      if ( (args.size()>0) && (args[args.size()-1] == "&") ) {
     1966        if ((*it).second.cex->IsThreadable(keyw) ) {
     1967          ThrId++;
     1968          CommandExeThr * thr =
     1969            new CommandExeThr(ThrId, (*it).second.cex, keyw, args, toks);
     1970          CmdThrExeList.push_back(thr);
     1971          cout << " Commander::ExecuteCommand() : Thread execution of command " << keyw << endl;
     1972          thr->start();
     1973          if (CmdThrExeList.size() > 5)  CleanThrList();
     1974          rc = 0;
     1975        }
     1976        else {
     1977          args.erase(args.end()-1);
     1978          for(size_t k=toks.size()-1; k>0; k--)
     1979            if (toks[k] == '&') { toks[k] = ' '; break; }
     1980          cout << " Commander::ExecuteCommand() : Thread execution NOT available for" << keyw << endl;
     1981          rc = (*it).second.cex->Execute(keyw, args, toks);
     1982        }
    19741983      }
    19751984      else  rc = (*it).second.cex->Execute(keyw, args, toks);
Note: See TracChangeset for help on using the changeset viewer.