summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-01-07 14:48:31 +0100
committerBruno Haible <bruno@clisp.org>2023-01-07 18:06:51 +0100
commit3943b5a215f4de6801dda56b63ddd582b175aed4 (patch)
tree0243122bcbc2b447a0c381776371b41a85f6993d
parentca97499c40c7d0544cd2521cced4e71b5e2a17eb (diff)
downloadgnulib-3943b5a215f4de6801dda56b63ddd582b175aed4.tar.gz
sched_yield: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB.
* m4/threadlib.m4: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB. All uses changed. * NEWS: Mention the change.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS3
-rw-r--r--m4/threadlib.m415
-rw-r--r--m4/yield.m44
-rw-r--r--modules/pthread-cond-tests2
-rw-r--r--modules/pthread-mutex-tests2
-rw-r--r--modules/pthread-once-tests2
-rw-r--r--modules/pthread-rwlock-tests2
-rw-r--r--modules/pthread-spin-tests2
-rw-r--r--modules/pthread-tss-tests2
-rw-r--r--modules/sched-c++-tests2
-rw-r--r--modules/sched_yield2
12 files changed, 29 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index cb61ac4bc2..634203127f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2023-01-07 Bruno Haible <bruno@clisp.org>
+ sched_yield: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB.
+ * m4/threadlib.m4: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB.
+ All uses changed.
+ * NEWS: Mention the change.
+
+2023-01-07 Bruno Haible <bruno@clisp.org>
+
pthread_sigmask: Rename LIB_PTHREAD_SIGMASK to PTHREAD_SIGMASK_LIB.
* m4/pthread_sigmask.m4: Rename LIB_PTHREAD_SIGMASK to
PTHREAD_SIGMASK_LIB.
diff --git a/NEWS b/NEWS
index ec6147be99..e5605ee295 100644
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,9 @@ User visible incompatible changes
Date Modules Changes
+2023-01-07 sched_yield Link with $(SCHED_YIELD_LIB) instead of
+ $(LIB_SCHED_YIELD).
+
2023-01-07 pthread_sigmask Link with $(PTHREAD_SIGMASK_LIB) instead of
$(LIB_PTHREAD_SIGMASK).
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index ff959346c0..332491d42f 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 32
+# threadlib.m4 serial 33
dnl Copyright (C) 2005-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,
@@ -174,7 +174,7 @@ dnl Sets the variable LIBPMULTITHREAD, for programs that really need
dnl multithread functionality. The difference between LIBPTHREAD and
dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
-dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl Sets the variable SCHED_YIELD_LIB to the linker options needed to use the
dnl sched_yield() function.
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
dnl multithread-safe programs.
@@ -297,13 +297,16 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
[AC_LANG_PROGRAM(
[[#include <sched.h>]],
[[sched_yield ();]])],
- [LIB_SCHED_YIELD=
+ [SCHED_YIELD_LIB=
],
[dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
- AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ AC_CHECK_LIB([rt], [sched_yield], [SCHED_YIELD_LIB=-lrt],
[dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
- AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ AC_CHECK_LIB([posix4], [sched_yield], [SCHED_YIELD_LIB=-lposix4])])
])
+ AC_SUBST([SCHED_YIELD_LIB])
+ dnl For backward compatibility.
+ LIB_SCHED_YIELD="$SCHED_YIELD_LIB"
AC_SUBST([LIB_SCHED_YIELD])
gl_pthreadlib_body_done=done
@@ -362,7 +365,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
fi
else
dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
- LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ LIBSTDTHREAD="$LIBPMULTITHREAD $SCHED_YIELD_LIB"
fi
;;
esac
diff --git a/m4/yield.m4 b/m4/yield.m4
index 3bfb8cda5b..4eb6bd9808 100644
--- a/m4/yield.m4
+++ b/m4/yield.m4
@@ -1,4 +1,4 @@
-# yield.m4 serial 4
+# yield.m4 serial 5
dnl Copyright (C) 2005-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,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_YIELD],
AC_REQUIRE([gl_THREADLIB])
if test $gl_threads_api = posix; then
- YIELD_LIB="$LIB_SCHED_YIELD"
+ YIELD_LIB="$SCHED_YIELD_LIB"
else
YIELD_LIB=
fi
diff --git a/modules/pthread-cond-tests b/modules/pthread-cond-tests
index 75a335d565..b104ae0651 100644
--- a/modules/pthread-cond-tests
+++ b/modules/pthread-cond-tests
@@ -13,4 +13,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-cond
check_PROGRAMS += test-pthread-cond
-test_pthread_cond_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@
+test_pthread_cond_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@
diff --git a/modules/pthread-mutex-tests b/modules/pthread-mutex-tests
index c419dcc00d..4575ef5c79 100644
--- a/modules/pthread-mutex-tests
+++ b/modules/pthread-mutex-tests
@@ -12,4 +12,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-mutex
check_PROGRAMS += test-pthread-mutex
-test_pthread_mutex_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@
+test_pthread_mutex_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@
diff --git a/modules/pthread-once-tests b/modules/pthread-once-tests
index d77dc19a5a..fc89cbcfcf 100644
--- a/modules/pthread-once-tests
+++ b/modules/pthread-once-tests
@@ -14,4 +14,4 @@ Makefile.am:
TESTS += test-pthread-once1 test-pthread-once2
check_PROGRAMS += test-pthread-once1 test-pthread-once2
test_pthread_once1_LDADD = $(LDADD) @LIBPMULTITHREAD@
-test_pthread_once2_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@
+test_pthread_once2_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@
diff --git a/modules/pthread-rwlock-tests b/modules/pthread-rwlock-tests
index 594f6b6601..af29895580 100644
--- a/modules/pthread-rwlock-tests
+++ b/modules/pthread-rwlock-tests
@@ -13,4 +13,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-rwlock
check_PROGRAMS += test-pthread-rwlock
-test_pthread_rwlock_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@
+test_pthread_rwlock_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@
diff --git a/modules/pthread-spin-tests b/modules/pthread-spin-tests
index aafe8c7bcd..9dfa698ca4 100644
--- a/modules/pthread-spin-tests
+++ b/modules/pthread-spin-tests
@@ -17,4 +17,4 @@ AC_REQUIRE([gl_SEMAPHORE])
Makefile.am:
TESTS += test-pthread-spin
check_PROGRAMS += test-pthread-spin
-test_pthread_spin_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@
+test_pthread_spin_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@
diff --git a/modules/pthread-tss-tests b/modules/pthread-tss-tests
index caa4520e52..1d339345dd 100644
--- a/modules/pthread-tss-tests
+++ b/modules/pthread-tss-tests
@@ -12,4 +12,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-tss
check_PROGRAMS += test-pthread-tss
-test_pthread_tss_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@
+test_pthread_tss_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@
diff --git a/modules/sched-c++-tests b/modules/sched-c++-tests
index 28c6ea184d..5e025de0ca 100644
--- a/modules/sched-c++-tests
+++ b/modules/sched-c++-tests
@@ -15,5 +15,5 @@ if ANSICXX
TESTS += test-sched-c++
check_PROGRAMS += test-sched-c++
test_sched_c___SOURCES = test-sched-c++.cc
-test_sched_c___LDADD = $(LDADD) $(LIB_SCHED_YIELD)
+test_sched_c___LDADD = $(LDADD) $(SCHED_YIELD_LIB)
endif
diff --git a/modules/sched_yield b/modules/sched_yield
index 6d683d58d4..ad29bcafb9 100644
--- a/modules/sched_yield
+++ b/modules/sched_yield
@@ -24,7 +24,7 @@ Include:
<sched.h>
Link:
-$(LIB_SCHED_YIELD)
+$(SCHED_YIELD_LIB)
License:
LGPLv2+