aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/misc.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-11-24 13:16:22 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-11-24 13:16:22 +0000
commit8878cc4cd7aabc7b2e38bed573fefabed639fa1d (patch)
tree3b2b3f759780d2e6900d598205daa653e7db7362 /src/interfaces/ecpg/ecpglib/misc.c
parent040e1cef919fa3c136d7d6444dcac77d30d89d30 (diff)
downloadpostgresql-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/misc.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/misc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c
index d9a77ff3266..c05fcd5d7e9 100644
--- a/src/interfaces/ecpg/ecpglib/misc.c
+++ b/src/interfaces/ecpg/ecpglib/misc.c
@@ -1,11 +1,11 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.16 2003/10/21 15:34:34 tgl Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.17 2003/11/24 13:16:22 petere Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#include <limits.h>
#include <unistd.h>
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
#include <pthread.h>
#endif
#include "ecpgtype.h"
@@ -55,7 +55,7 @@ static struct sqlca_t sqlca_init =
}
};
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
static pthread_key_t sqlca_key;
static pthread_once_t sqlca_key_once = PTHREAD_ONCE_INIT;
@@ -88,7 +88,7 @@ static struct sqlca_t sqlca =
};
#endif
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
static pthread_mutex_t debug_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t debug_init_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
@@ -117,7 +117,7 @@ ECPGinit(const struct connection * con, const char *connection_name, const int l
return (true);
}
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
static void
ecpg_sqlca_key_init(void)
{
@@ -128,7 +128,7 @@ ecpg_sqlca_key_init(void)
struct sqlca_t *
ECPGget_sqlca(void)
{
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
struct sqlca_t *sqlca;
pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
@@ -211,7 +211,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
void
ECPGdebug(int n, FILE *dbgs)
{
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_lock(&debug_init_mutex);
#endif
@@ -219,7 +219,7 @@ ECPGdebug(int n, FILE *dbgs)
debugstream = dbgs;
ECPGlog("ECPGdebug: set to %d\n", simple_debug);
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_unlock(&debug_init_mutex);
#endif
}
@@ -229,7 +229,7 @@ ECPGlog(const char *format,...)
{
va_list ap;
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_lock(&debug_mutex);
#endif
@@ -239,7 +239,7 @@ ECPGlog(const char *format,...)
if (f == NULL)
{
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_unlock(&debug_mutex);
#endif
return;
@@ -255,7 +255,7 @@ ECPGlog(const char *format,...)
ECPGfree(f);
}
-#ifdef USE_THREADS
+#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_unlock(&debug_mutex);
#endif
}