diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2003-11-24 13:16:22 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2003-11-24 13:16:22 +0000 |
commit | 8878cc4cd7aabc7b2e38bed573fefabed639fa1d (patch) | |
tree | 3b2b3f759780d2e6900d598205daa653e7db7362 /src/interfaces/ecpg/ecpglib/connect.c | |
parent | 040e1cef919fa3c136d7d6444dcac77d30d89d30 (diff) | |
download | postgresql-8878cc4cd7aabc7b2e38bed573fefabed639fa1d.tar.gz postgresql-8878cc4cd7aabc7b2e38bed573fefabed639fa1d.zip |
Rename USE_THREADS to ENABLE_THREAD_SAFETY to avoid name clash with Perl.
Fixes compilation failure with --enable-thread-safety --with-perl and Perl
5.6.1.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/connect.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/connect.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 4b7683633bd..31d558d4476 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -1,9 +1,9 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.17 2003/08/24 18:36:38 petere Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.18 2003/11/24 13:16:22 petere Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY #include <pthread.h> #endif #include "ecpgtype.h" @@ -12,7 +12,7 @@ #include "extern.h" #include "sqlca.h" -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY static pthread_mutex_t connections_mutex = PTHREAD_MUTEX_INITIALIZER; #endif static struct connection *all_connections = NULL; @@ -45,13 +45,13 @@ ECPGget_connection(const char *connection_name) { struct connection *ret = NULL; -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_lock(&connections_mutex); #endif ret = ecpg_get_connection_nr(connection_name); -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&connections_mutex); #endif @@ -355,7 +355,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p realname = strdup(dbname); /* add connection to our list */ -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_lock(&connections_mutex); #endif if (connection_name != NULL) @@ -387,7 +387,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p char *db = realname ? realname : "<DEFAULT>"; ecpg_finish(this); -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&connections_mutex); #endif ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n", @@ -411,7 +411,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p ECPGfree(dbname); return false; } -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&connections_mutex); #endif @@ -440,7 +440,7 @@ ECPGdisconnect(int lineno, const char *connection_name) struct sqlca_t *sqlca = ECPGget_sqlca(); struct connection *con; -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_lock(&connections_mutex); #endif @@ -461,7 +461,7 @@ ECPGdisconnect(int lineno, const char *connection_name) if (!ECPGinit(con, connection_name, lineno)) { -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&connections_mutex); #endif return (false); @@ -470,7 +470,7 @@ ECPGdisconnect(int lineno, const char *connection_name) ecpg_finish(con); } -#ifdef USE_THREADS +#ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&connections_mutex); #endif |