From 0b8317fee5b060372099cedae72fde9ac47106a4 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 11 Apr 2018 00:26:09 +0300 Subject: [PATCH] Allow subthreadcreate_test to be compiled with zero NTHREADS * tests/subthread_create.c [AO_HAVE_fetch_and_add1] (main): Skip the test (except for printing the number of created and ended threads) if NTHREADS is 0. --- tests/subthread_create.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/subthread_create.c b/tests/subthread_create.c index af74e14f..5d9c831d 100644 --- a/tests/subthread_create.c +++ b/tests/subthread_create.c @@ -99,6 +99,7 @@ volatile AO_t thread_ended_cnt = 0; int main(void) { +#if NTHREADS > 0 int i; # ifdef GC_PTHREADS int err; @@ -150,6 +151,7 @@ int main(void) CloseHandle(th[i]); # endif } +#endif printf("subthread_create: created %d threads (%d ended)\n", (int)AO_load(&thread_created_cnt), (int)AO_load(&thread_ended_cnt)); return 0; -- 2.40.0