diff --git a/lib/Dispatcher/Dispatcher.cpp b/lib/Dispatcher/Dispatcher.cpp index 19a77b922b..74d4b7e65d 100644 --- a/lib/Dispatcher/Dispatcher.cpp +++ b/lib/Dispatcher/Dispatcher.cpp @@ -120,7 +120,7 @@ bool Dispatcher::isRunning () { //////////////////////////////////////////////////////////////////////////////// void Dispatcher::addQueue (string const& name, size_t nrThreads) { - _queues[name] = new DispatcherQueue(this, defaultDispatcherThread, nrThreads); + _queues[name] = new DispatcherQueue(this, name, defaultDispatcherThread, nrThreads); } ///////////////////////////////////////////////////////////////////////// @@ -128,7 +128,7 @@ void Dispatcher::addQueue (string const& name, size_t nrThreads) { ///////////////////////////////////////////////////////////////////////// void Dispatcher::addQueue (string const& name, newDispatcherThread_fptr func, size_t nrThreads) { - _queues[name] = new DispatcherQueue(this, func, nrThreads); + _queues[name] = new DispatcherQueue(this, name, func, nrThreads); } //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/Dispatcher/DispatcherQueue.cpp b/lib/Dispatcher/DispatcherQueue.cpp index f68b1fa434..a17a419a68 100644 --- a/lib/Dispatcher/DispatcherQueue.cpp +++ b/lib/Dispatcher/DispatcherQueue.cpp @@ -41,9 +41,11 @@ namespace triagens { // ----------------------------------------------------------------------------- DispatcherQueue::DispatcherQueue (Dispatcher* dispatcher, + string const& name, Dispatcher::newDispatcherThread_fptr creator, size_t nrThreads) - : stopping(0), + : _name(name), + stopping(0), monopolizer(0), nrStarted(0), nrRunning(0), @@ -86,7 +88,7 @@ namespace triagens { return; } - LOGGER_DEBUG << "beginning shutdown sequence of dispatcher queue"; + LOGGER_DEBUG << "beginning shutdown sequence of dispatcher queue '" << _name <<"'"; // broadcast the we want to stop size_t const MAX_TRIES = 10; @@ -97,7 +99,7 @@ namespace triagens { { CONDITION_LOCKER(guard, accessQueue); - LOGGER_TRACE << "shutting down dispatcher queue, " + LOGGER_TRACE << "shutting down dispatcher queue '" << _name << "', " << nrRunning << " running threads, " << nrWaiting << " waiting threads, " << nrSpecial << " special threads"; @@ -112,7 +114,7 @@ namespace triagens { usleep(10000); } - LOGGER_DEBUG << "shutting down dispatcher queue, " + LOGGER_DEBUG << "shutting down dispatcher queue '" << _name << "', " << nrRunning << " running threads, " << nrWaiting << " waiting threads, " << nrSpecial << " special threads"; diff --git a/lib/Dispatcher/DispatcherQueue.h b/lib/Dispatcher/DispatcherQueue.h index 7f9cefef98..aee5b1dafd 100644 --- a/lib/Dispatcher/DispatcherQueue.h +++ b/lib/Dispatcher/DispatcherQueue.h @@ -52,6 +52,7 @@ namespace triagens { ///////////////////////////////////////////////////////////////////////////// DispatcherQueue (Dispatcher* dispatcher, + std::string const& name, Dispatcher::newDispatcherThread_fptr, size_t nrThreads); @@ -180,6 +181,7 @@ namespace triagens { Dispatcher* dispatcher; private: + string const _name; Dispatcher::newDispatcherThread_fptr createDispatcherThread; }; }