Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move timer noise from message log to debug output
  • Loading branch information
jef-n committed Feb 27, 2014
1 parent dd03dd0 commit 89b50df
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/core/qgsconnectionpool.h
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
{
}

Expand All @@ -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;
}
Expand All @@ -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();

Expand Down

0 comments on commit 89b50df

Please sign in to comment.