* 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>
+
+ 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.
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).
-# 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,
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.
[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
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
-# 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,
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
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@
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@
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@
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@
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@
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@
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
<sched.h>
Link:
-$(LIB_SCHED_YIELD)
+$(SCHED_YIELD_LIB)
License:
LGPLv2+