diff options
author | Thomas Munro | 2023-07-11 18:20:37 +0000 |
---|---|---|
committer | Thomas Munro | 2023-07-11 20:20:43 +0000 |
commit | 68a4b58eca032916e2aad78d63f717dcb147e906 (patch) | |
tree | d944d9ffb794df9d70c6408475f20d20a0580080 /src/interfaces/ecpg/test/expected/thread-alloc.c | |
parent | 11f36694091c97318e5a2bd28b35ffe9aa1c3b6a (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 <[email protected]>
Reviewed-by: Peter Eisentraut <[email protected]>
Reviewed-by: Heikki Linnakangas <[email protected]>
Discussion: https://postgr.es/m/CA%2BhUKGLtmexrpMtxBRLCVePqV_dtWG-ZsEbyPrYc%2BNBB2TkNsw%40mail.gmail.com
Diffstat (limited to 'src/interfaces/ecpg/test/expected/thread-alloc.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/thread-alloc.c | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/src/interfaces/ecpg/test/expected/thread-alloc.c b/src/interfaces/ecpg/test/expected/thread-alloc.c index 37ef44ed94b..3b31d27fd34 100644 --- a/src/interfaces/ecpg/test/expected/thread-alloc.c +++ b/src/interfaces/ecpg/test/expected/thread-alloc.c @@ -11,14 +11,6 @@ #include <stdlib.h> #include "ecpg_config.h" -#ifndef ENABLE_THREAD_SAFETY -int -main(void) -{ - printf("No threading enabled.\n"); - return 0; -} -#else #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -101,7 +93,7 @@ struct sqlca_t *ECPGget_sqlca(void); #endif -#line 26 "alloc.pgc" +#line 18 "alloc.pgc" #line 1 "regression.h" @@ -111,14 +103,14 @@ struct sqlca_t *ECPGget_sqlca(void); -#line 27 "alloc.pgc" +#line 19 "alloc.pgc" /* exec sql whenever sqlerror sqlprint ; */ -#line 29 "alloc.pgc" +#line 21 "alloc.pgc" /* exec sql whenever not found sqlprint ; */ -#line 30 "alloc.pgc" +#line 22 "alloc.pgc" #ifdef WIN32 @@ -134,54 +126,54 @@ static void* fn(void* arg) -#line 41 "alloc.pgc" +#line 33 "alloc.pgc" int value ; -#line 42 "alloc.pgc" +#line 34 "alloc.pgc" char name [ 100 ] ; -#line 43 "alloc.pgc" +#line 35 "alloc.pgc" char ** r = NULL ; /* exec sql end declare section */ -#line 44 "alloc.pgc" +#line 36 "alloc.pgc" value = (intptr_t) arg; sprintf(name, "Connection: %d", value); { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , name, 0); -#line 49 "alloc.pgc" +#line 41 "alloc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 49 "alloc.pgc" +#line 41 "alloc.pgc" { ECPGsetcommit(__LINE__, "on", NULL); -#line 50 "alloc.pgc" +#line 42 "alloc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 50 "alloc.pgc" +#line 42 "alloc.pgc" for (i = 1; i <= REPEATS; ++i) { { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select relname from pg_class where relname = 'pg_class'", ECPGt_EOIT, ECPGt_char,&(r),(long)0,(long)0,(1)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); -#line 53 "alloc.pgc" +#line 45 "alloc.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 53 "alloc.pgc" +#line 45 "alloc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 53 "alloc.pgc" +#line 45 "alloc.pgc" free(r); r = NULL; } { ECPGdisconnect(__LINE__, name); -#line 57 "alloc.pgc" +#line 49 "alloc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 57 "alloc.pgc" +#line 49 "alloc.pgc" return 0; @@ -215,4 +207,3 @@ int main () return 0; } -#endif |