summaryrefslogtreecommitdiff
path: root/pool.c
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-04-20 08:32:41 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-04-20 08:32:41 +0200
commitc6ed5885ba8841a746c98a79635998c8890e73f1 (patch)
tree6d3ca9a01703fcdf892e1a00a1482613b26bea0f /pool.c
parent0ea77430477d3c93173b7a16b44e6f6d9743ec0b (diff)
downloadpgfuse-c6ed5885ba8841a746c98a79635998c8890e73f1.tar.gz
pgfuse-c6ed5885ba8841a746c98a79635998c8890e73f1.tar.bz2
updated some documentation
changed pool db connection allocation strategy
Diffstat (limited to 'pool.c')
-rw-r--r--pool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pool.c b/pool.c
index 49b7c70..5ad56c5 100644
--- a/pool.c
+++ b/pool.c
@@ -166,7 +166,7 @@ int psql_pool_release( PgConnPool *pool, PGconn *conn )
res = pthread_mutex_lock( &pool->lock );
if( res < 0 ) return res;
- for( i = 1; i < pool->size; i++ ) {
+ for( i = pool->size; i >= 0; i-- ) {
if( pool->conns[i] == conn ) {
break;
}