gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER uses $LIBMULTITHREAD.
For this, it needs to require gl_THREADLIB, not gl_THREADLIB_EARLY.
Otherwise, we could have wrong configuration results.


2023-10-15  Bruno Haible  <br...@clisp.org>

        lock: Make Autoconf macro more robust.
        * m4/pthread_rwlock_rdlock.m4 (gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER):
        Require gl_THREADLIB, not gl_THREADLIB_EARLY. Needed to get the value of
        LIBMULTITHREAD.

diff --git a/m4/pthread_rwlock_rdlock.m4 b/m4/pthread_rwlock_rdlock.m4
index 7cc650c49d..1fdc532ae8 100644
--- a/m4/pthread_rwlock_rdlock.m4
+++ b/m4/pthread_rwlock_rdlock.m4
@@ -1,4 +1,4 @@
-# pthread_rwlock_rdlock.m4 serial 6
+# pthread_rwlock_rdlock.m4 serial 7
 dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,7 @@
 dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
 AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
 [
-  AC_REQUIRE([gl_THREADLIB_EARLY])
+  AC_REQUIRE([gl_THREADLIB])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
     [gl_cv_pthread_rwlock_rdlock_prefer_writer],




Reply via email to