mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Fix new pthread code to respect --disable-thread-safety.
Don't try to compile src/port/pthread_barrier_wait.c if we opted out of
threads at configure time. Revealed by build farm member gaur, which
can't compile this code because of problems with its pthread
implementation. It shouldn't be trying to, because it's using
--disable-thread-safety.
Defect in commit 44bf3d50
.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/2568537.1615603606%40sss.pgh.pa.us
This commit is contained in:
10
configure.ac
10
configure.ac
@ -1143,7 +1143,6 @@ AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
|
||||
AC_SEARCH_LIBS(shm_open, rt)
|
||||
AC_SEARCH_LIBS(shm_unlink, rt)
|
||||
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
|
||||
AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
|
||||
# Solaris:
|
||||
AC_SEARCH_LIBS(fdatasync, [rt posix4])
|
||||
# Required for thread_test.c on Solaris
|
||||
@ -1156,6 +1155,10 @@ AC_SEARCH_LIBS(shmget, cygipc)
|
||||
# *BSD:
|
||||
AC_SEARCH_LIBS(backtrace_symbols, execinfo)
|
||||
|
||||
if test "$enable_thread_safety" = yes; then
|
||||
AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
|
||||
fi
|
||||
|
||||
if test "$with_readline" = yes; then
|
||||
PGAC_CHECK_READLINE
|
||||
if test x"$pgac_cv_check_readline" = x"no"; then
|
||||
@ -1744,7 +1747,6 @@ AC_REPLACE_FUNCS(m4_normalize([
|
||||
mkdtemp
|
||||
pread
|
||||
preadv
|
||||
pthread_barrier_wait
|
||||
pwrite
|
||||
pwritev
|
||||
random
|
||||
@ -1755,6 +1757,10 @@ AC_REPLACE_FUNCS(m4_normalize([
|
||||
strtof
|
||||
]))
|
||||
|
||||
if test "$enable_thread_safety" = yes; then
|
||||
AC_REPLACE_FUNCS(pthread_barrier_wait)
|
||||
fi
|
||||
|
||||
if test "$PORTNAME" = "win32" -o "$PORTNAME" = "cygwin"; then
|
||||
# Cygwin and (apparently, based on test results) Mingw both
|
||||
# have a broken strtof(), so substitute the same replacement
|
||||
|
Reference in New Issue
Block a user