summaryrefslogtreecommitdiff
path: root/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'pool.c')
-rw-r--r--pool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pool.c b/pool.c
index 82b0644..f83af07 100644
--- a/pool.c
+++ b/pool.c
@@ -16,6 +16,7 @@
*/
#include "pool.h"
+#include "util.h" /* common project utilities */
#include <string.h> /* for strlen, memcpy, strcmp */
#include <errno.h> /* for ENOENT and friends */
@@ -96,7 +97,7 @@ int psql_pool_destroy( PgConnPool *pool )
break;
case USED:
syslog( LOG_ERR, "Destroying pool connection to thread %p which is still in use",
- pool->thread[i] );
+ (void *)pool->thread[i] );
PQfinish( pool->conns[i] );
break;
case ERROR:
@@ -124,7 +125,7 @@ PGconn *psql_pool_acquire( PgConnPool *pool )
res = pthread_mutex_lock( &pool->lock );
if( res < 0 ) {
syslog( LOG_ERR, "Locking mutex failed for thread %p: %d",
- pthread_self( ), res );
+ THREAD_ID, res );
return NULL;
}
@@ -146,7 +147,7 @@ PGconn *psql_pool_acquire( PgConnPool *pool )
res = pthread_cond_wait( &pool->cond, &pool->lock );
if( res < 0 ) {
syslog( LOG_ERR, "Error waiting for free condition in thread %p: %d",
- pthread_self( ), res );
+ THREAD_ID, res );
(void)pthread_mutex_unlock( &pool->lock );
return NULL;
}