From: Bruno Haible <bruno@clisp.org>
Date: Mon, 3 Jun 2024 10:30:32 +0000 (+0200)
Subject: pthread-mutex, pthread-rwlock: Fix a compilation error.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=36602da7df7df9ffdccab18aa4391b4db31f8f9b;p=gnulib.git

pthread-mutex, pthread-rwlock: Fix a compilation error.

* modules/pthread-mutex-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
* modules/pthread-rwlock-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
---

diff --git a/ChangeLog b/ChangeLog
index c379de20a3..0380cf7bcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-06-03  Bruno Haible  <bruno@clisp.org>
+
+	pthread-mutex, pthread-rwlock: Fix a compilation error.
+	* modules/pthread-mutex-tests (Files): Add m4/semaphore.m4.
+	(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
+	* modules/pthread-rwlock-tests (Files): Add m4/semaphore.m4.
+	(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
+
 2024-06-02  Bruno Haible  <bruno@clisp.org>
 
 	c-strtod, c-strtof, c-strtold: Fix link error on AIX.
diff --git a/modules/pthread-mutex-tests b/modules/pthread-mutex-tests
index 9475a84a99..cc234afc77 100644
--- a/modules/pthread-mutex-tests
+++ b/modules/pthread-mutex-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-pthread-mutex.c
 tests/atomic-int-posix.h
 tests/macros.h
+m4/semaphore.m4
 
 Depends-on:
 pthread-thread
@@ -9,6 +10,8 @@ sched_yield
 random
 
 configure.ac:
+AC_CHECK_HEADERS_ONCE([semaphore.h])
+AC_REQUIRE([gl_SEMAPHORE])
 
 Makefile.am:
 TESTS += test-pthread-mutex
diff --git a/modules/pthread-rwlock-tests b/modules/pthread-rwlock-tests
index 129570b67d..b63a267876 100644
--- a/modules/pthread-rwlock-tests
+++ b/modules/pthread-rwlock-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-pthread-rwlock.c
 tests/atomic-int-posix.h
 tests/macros.h
+m4/semaphore.m4
 
 Depends-on:
 pthread-thread
@@ -10,6 +11,8 @@ sched_yield
 random
 
 configure.ac:
+AC_CHECK_HEADERS_ONCE([semaphore.h])
+AC_REQUIRE([gl_SEMAPHORE])
 
 Makefile.am:
 TESTS += test-pthread-rwlock