Skip to content
Permalink
Browse files

move timer noise from message log to debug output

  • Loading branch information
jef-n committed Feb 27, 2014
1 parent dd03dd0 commit 89b50dff7e6ffe628d848196105ff3dd09785b94
Showing with 18 additions and 5 deletions.
  1. +18 −5 src/core/qgsconnectionpool.h
@@ -23,6 +23,9 @@
#include <QStack>
#include <QTime>
#include <QTimer>
#include <QThread>

#include "qgslogger.h"

#define CONN_POOL_MAX_CONCURRENT_CONNS 4
#define CONN_POOL_EXPIRATION_TIME 60 // in seconds
@@ -55,9 +58,9 @@ class QgsConnectionPoolGroup
};

QgsConnectionPoolGroup( const QString& ci )
: connInfo( ci )
, sem( CONN_POOL_MAX_CONCURRENT_CONNS )
, expirationTimer( 0 )
: connInfo( ci )
, sem( CONN_POOL_MAX_CONCURRENT_CONNS )
, expirationTimer( 0 )
{
}

@@ -84,7 +87,12 @@ class QgsConnectionPoolGroup

// no need to run if nothing can expire
if ( conns.isEmpty() )
expirationTimer->stop();
{
if ( QThread::currentThread() == qApp->thread() )
expirationTimer->stop();
else
QgsDebugMsg( "expirationTimer not stopped from thread" ); // TODO use signals in that case?
}

return i.c;
}
@@ -111,7 +119,12 @@ class QgsConnectionPoolGroup
conns.push( i );

if ( !expirationTimer->isActive() )
expirationTimer->start();
{
if ( QThread::currentThread() == qApp->thread() )
expirationTimer->start();
else
QgsDebugMsg( "expirationTimer not started from thread" ); // TODO use signals in that case?
}

connMutex.unlock();

0 comments on commit 89b50df

Please sign in to comment.
You can’t perform that action at this time.