aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/connect.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 838cedf5c94..2dded3a17d4 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.22 2004/06/10 22:26:21 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.23 2004/08/29 05:06:59 momjian Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -14,8 +14,9 @@
#ifdef ENABLE_THREAD_SAFETY
static pthread_mutex_t connections_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_key_t actual_connection_key;
+static pthread_key_t actual_connection_key;
static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT;
+
#else
static struct connection *actual_connection = NULL;
#endif
@@ -25,7 +26,7 @@ static struct connection *all_connections = NULL;
static void
ecpg_actual_connection_init(void)
{
- pthread_key_create(&actual_connection_key, NULL);
+ pthread_key_create(&actual_connection_key, NULL);
}
#endif
@@ -114,8 +115,8 @@ ecpg_finish(struct connection * act)
}
#ifdef ENABLE_THREAD_SAFETY
- if( pthread_getspecific(actual_connection_key) == act )
- pthread_setspecific(actual_connection_key, all_connections);
+ if (pthread_getspecific(actual_connection_key) == act)
+ pthread_setspecific(actual_connection_key, all_connections);
#else
if (actual_connection == act)
actual_connection = all_connections;