From: Bruno Haible Date: Mon, 18 May 2026 19:21:34 +0000 (+0200) Subject: thread-optim tests: Fix a test failure with --disable-threads. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=b4f2e95b6decbad00da5ce912053177fcc4f2d25;p=thirdparty%2Fgnulib.git thread-optim tests: Fix a test failure with --disable-threads. * tests/test-thread-optim2.c: Skip the test if multithreading is not enabled. --- diff --git a/ChangeLog b/ChangeLog index 6ec8724e19..10277133f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-05-18 Bruno Haible + + thread-optim tests: Fix a test failure with --disable-threads. + * tests/test-thread-optim2.c: Skip the test if multithreading is not + enabled. + 2026-05-18 Bruno Haible term-style-control: Make multithread-safe, part 5: SIGCONT handler. diff --git a/tests/test-thread-optim2.c b/tests/test-thread-optim2.c index bd2e3b2955..5a61b687aa 100644 --- a/tests/test-thread-optim2.c +++ b/tests/test-thread-optim2.c @@ -25,6 +25,8 @@ #include "macros.h" +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + static int dummy; static void * @@ -50,3 +52,20 @@ main () return test_exit_status; } + +#else + +/* No multithreading available. + glthread_create is a dummy that just returns ENOSYS. + gl_thread_create therefore aborts. */ + +#include + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif