summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/descriptor.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-07-12 06:20:37 +1200
committerThomas Munro <tmunro@postgresql.org>2023-07-12 08:20:43 +1200
commit68a4b58eca032916e2aad78d63f717dcb147e906 (patch)
treed944d9ffb794df9d70c6408475f20d20a0580080 /src/interfaces/ecpg/ecpglib/descriptor.c
parent11f36694091c97318e5a2bd28b35ffe9aa1c3b6a (diff)
Remove --disable-thread-safety and related code.
All supported computers have either POSIX or Windows threads, and we no longer have any automated testing of --disable-thread-safety. We define a vestigial ENABLE_THREAD_SAFETY macro to 1 in ecpg_config.h in case it is useful, but we no longer test it anywhere in PostgreSQL code, and associated dead code paths are removed. The Meson and perl-based Windows build scripts never had an equivalent build option. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/CA%2BhUKGLtmexrpMtxBRLCVePqV_dtWG-ZsEbyPrYc%2BNBB2TkNsw%40mail.gmail.com
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/descriptor.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/descriptor.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c
index 883a210a812..ad279e245c4 100644
--- a/src/interfaces/ecpg/ecpglib/descriptor.c
+++ b/src/interfaces/ecpg/ecpglib/descriptor.c
@@ -19,7 +19,6 @@
static void descriptor_free(struct descriptor *desc);
/* We manage descriptors separately for each thread. */
-#ifdef ENABLE_THREAD_SAFETY
static pthread_key_t descriptor_key;
static pthread_once_t descriptor_once = PTHREAD_ONCE_INIT;
@@ -49,12 +48,6 @@ set_descriptors(struct descriptor *value)
{
pthread_setspecific(descriptor_key, value);
}
-#else
-static struct descriptor *all_descriptors = NULL;
-
-#define get_descriptors() (all_descriptors)
-#define set_descriptors(value) do { all_descriptors = (value); } while(0)
-#endif
/* old internal convenience function that might go away later */
static PGresult *
@@ -782,8 +775,6 @@ ECPGdeallocate_desc(int line, const char *name)
return false;
}
-#ifdef ENABLE_THREAD_SAFETY
-
/* Deallocate all descriptors in the list */
static void
descriptor_deallocate_all(struct descriptor *list)
@@ -796,7 +787,6 @@ descriptor_deallocate_all(struct descriptor *list)
list = next;
}
}
-#endif /* ENABLE_THREAD_SAFETY */
bool
ECPGallocate_desc(int line, const char *name)