]> Savannah Git Hosting - gnulib.git/commitdiff
thrd: Refactor.
authorBruno Haible <bruno@clisp.org>
Fri, 18 Aug 2023 19:14:40 +0000 (21:14 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 30 Aug 2023 10:14:40 +0000 (12:14 +0200)
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_JOIN_NULL, not
BROKEN_THRD_JOIN. Rename gl_cv_func_thrd_join_works to
gl_cv_func_thrd_join_null_works.
* lib/thrd.c: Test BROKEN_THRD_JOIN_NULL instead of BROKEN_THRD_JOIN.

ChangeLog
lib/thrd.c
m4/thrd.m4

index 661dd10869c323397904a987393b4cd64861a07a..41dfa771774361000987b3b70bd26bde06b38e9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-08-18  Bruno Haible  <bruno@clisp.org>
+
+       thrd: Refactor.
+       * m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_JOIN_NULL, not
+       BROKEN_THRD_JOIN. Rename gl_cv_func_thrd_join_works to
+       gl_cv_func_thrd_join_null_works.
+       * lib/thrd.c: Test BROKEN_THRD_JOIN_NULL instead of BROKEN_THRD_JOIN.
+
 2023-08-18  Bruno Haible  <bruno@clisp.org>
 
        thrd: On AIX 7.1 and 7.2, override also thrd_exit.
index 36117bb6de43f3642fbc0727e728ea1978dac6fb..687a0920ec8dd53e364341a501c572a3aeea077b 100644 (file)
@@ -218,7 +218,7 @@ rpl_thrd_exit (int exitcode)
 
 # endif
 
-# if BROKEN_THRD_JOIN
+# if BROKEN_THRD_JOIN_NULL
 
 /* On Solaris 11.4, thrd_join crashes when the second argument is NULL.  */
 int
index fed111695fa3a1ba15ebc06011766c7399a50d39..1c0a611ae233f15bb12059636a8417f8ad088e2a 100644 (file)
@@ -1,4 +1,4 @@
-# thrd.m4 serial 2
+# thrd.m4 serial 3
 dnl Copyright (C) 2019-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,
@@ -25,8 +25,8 @@ AC_DEFUN([gl_FUNC_THRD_JOIN],
     fi
 
     dnl On Solaris 11.4, thrd_join crashes when the second argument is NULL.
-    AC_CACHE_CHECK([whether thrd_join works],
-      [gl_cv_func_thrd_join_works],
+    AC_CACHE_CHECK([whether thrd_join with NULL argument works],
+      [gl_cv_func_thrd_join_null_works],
       [save_LIBS="$LIBS"
        LIBS="$LIBS $LIBSTDTHREAD"
        AC_RUN_IFELSE(
@@ -45,22 +45,22 @@ AC_DEFUN([gl_FUNC_THRD_JOIN],
                 return 2;
               return 0;
             ]])],
-         [gl_cv_func_thrd_join_works=yes],
-         [gl_cv_func_thrd_join_works=no],
+         [gl_cv_func_thrd_join_null_works=yes],
+         [gl_cv_func_thrd_join_null_works=no],
          [case "$host_os" in
                       # Only Solaris is known to be broken.
-            solaris*) gl_cv_func_thrd_join_works="guessing no" ;;
-            *)        gl_cv_func_thrd_join_works="guessing yes" ;;
+            solaris*) gl_cv_func_thrd_join_null_works="guessing no" ;;
+            *)        gl_cv_func_thrd_join_null_works="guessing yes" ;;
           esac
          ])
        LIBS="$save_LIBS"
       ])
-    case "$gl_cv_func_thrd_join_works" in
+    case "$gl_cv_func_thrd_join_null_works" in
       *yes) ;;
       *)
         REPLACE_THRD_JOIN=1
-        AC_DEFINE([BROKEN_THRD_JOIN], [1],
-          [Define if the thrd_join function does not behave as in ISO C 11.])
+        AC_DEFINE([BROKEN_THRD_JOIN_NULL], [1],
+          [Define if the thrd_join function, when given a NULL argument, does not behave as in ISO C 11.])
         ;;
     esac
   fi