summaryrefslogtreecommitdiffstats
path: root/gl/m4/pthread_rwlock_rdlock.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/pthread_rwlock_rdlock.m4')
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m444
1 files changed, 23 insertions, 21 deletions
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
index ae6a8853..aec9f076 100644
--- a/gl/m4/pthread_rwlock_rdlock.m4
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -1,8 +1,10 @@
1# pthread_rwlock_rdlock.m4 serial 4 1# pthread_rwlock_rdlock.m4
2dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2017-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7dnl From Bruno Haible. 9dnl From Bruno Haible.
8dnl Inspired by 10dnl Inspired by
@@ -34,11 +36,11 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
34dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052 36dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
35AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], 37AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
36[ 38[
37 AC_REQUIRE([gl_THREADLIB_EARLY]) 39 AC_REQUIRE([gl_THREADLIB])
38 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 40 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
39 AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader], 41 AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
40 [gl_cv_pthread_rwlock_rdlock_prefer_writer], 42 [gl_cv_pthread_rwlock_rdlock_prefer_writer],
41 [save_LIBS="$LIBS" 43 [saved_LIBS="$LIBS"
42 LIBS="$LIBS $LIBMULTITHREAD" 44 LIBS="$LIBS $LIBMULTITHREAD"
43 AC_RUN_IFELSE( 45 AC_RUN_IFELSE(
44 [AC_LANG_SOURCE([[ 46 [AC_LANG_SOURCE([[
@@ -156,25 +158,25 @@ main ()
156 [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes], 158 [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
157 [gl_cv_pthread_rwlock_rdlock_prefer_writer=no], 159 [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
158 [case "$host_os" in 160 [case "$host_os" in
159 # Guess no on glibc systems. 161 # Guess no on glibc systems.
160 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 162 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
161 # Guess no on musl systems. 163 # Guess no on musl systems.
162 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 164 *-musl* | midipix*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
163 # Guess no on bionic systems. 165 # Guess no on bionic systems.
164 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 166 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
165 # Guess yes on native Windows with the mingw-w64 winpthreads library. 167 # Guess yes on native Windows with the mingw-w64 winpthreads library.
166 # Guess no on native Windows with the gnulib windows-rwlock module. 168 # Guess no on native Windows with the gnulib windows-rwlock module.
167 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then 169 mingw* | windows*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
168 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" 170 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
169 else 171 else
170 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" 172 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
171 fi 173 fi
172 ;; 174 ;;
173 # If we don't know, obey --enable-cross-guesses. 175 # If we don't know, obey --enable-cross-guesses.
174 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; 176 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
175 esac 177 esac
176 ]) 178 ])
177 LIBS="$save_LIBS" 179 LIBS="$saved_LIBS"
178 ]) 180 ])
179 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in 181 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
180 *yes) 182 *yes)