1
0
Fork 0

added queue name in log

This commit is contained in:
Frank Celler 2012-06-17 18:13:31 +02:00
parent 292b78002d
commit 47db93a546
3 changed files with 10 additions and 6 deletions

View File

@ -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);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -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";

View File

@ -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;
};
}