Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/command/TclThreadManager.cc

    r10624 r11071  
    3434#include "TclThreadManager.h"
    3535
    36 #include <boost/bind.hpp>
     36#include <functional>
    3737#include <boost/thread/thread.hpp>
    3838#include <boost/thread/locks.hpp>
     
    8686    };
    8787
    88     TclThreadManager* TclThreadManager::singletonPtr_s = 0;
     88    TclThreadManager* TclThreadManager::singletonPtr_s = nullptr;
    8989
    9090    /**
     
    145145            {
    146146                boost::shared_lock<boost::shared_mutex> lock(*this->interpreterBundlesMutex_);
    147                 for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
     147                for (const auto& mapEntry : this->interpreterBundles_)
    148148                {
    149                     if (it->first == 0)
     149                    if (mapEntry.first == 0)
    150150                        continue; // We'll handle the default interpreter later (and without threads of course)
    151151
    152                     TclInterpreterBundle* bundle = it->second;
     152                    TclInterpreterBundle* bundle = mapEntry.second;
    153153                    if (!bundle->queue_.empty())
    154154                    {
     
    163163                                {
    164164                                    // Start a thread to execute the command
    165                                     boost::thread(boost::bind(&tclThread, bundle, command));
     165                                    boost::thread(std::bind(&tclThread, bundle, command));
    166166                                }
    167167                                else
     
    289289        catch (const Tcl::tcl_error& e)
    290290        {
    291             bundle->interpreter_ = 0;
     291            bundle->interpreter_ = nullptr;
    292292            orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl;
    293293        }
     
    488488    void TclThreadManager::source(const std::string& file)
    489489    {
    490         boost::thread(boost::bind(&sourceThread, file));
     490        boost::thread(std::bind(&sourceThread, file));
    491491    }
    492492
     
    521521        {
    522522            TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
    523             return 0;
     523            return nullptr;
    524524        }
    525525    }
     
    551551
    552552        std::list<unsigned int> threads;
    553         for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
    554             if (it->first > 0 && it->first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
    555                 threads.push_back(it->first);
     553        for (const auto& mapEntry : this->interpreterBundles_)
     554            if (mapEntry.first > 0 && mapEntry.first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
     555                threads.push_back(mapEntry.first);
    556556        return threads;
    557557    }
Note: See TracChangeset for help on using the changeset viewer.