From: Ivan Maidanski Date: Tue, 10 Apr 2018 21:26:09 +0000 (+0300) Subject: Allow subthreadcreate_test to be compiled with zero NTHREADS X-Git-Tag: v8.0.0~243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b8317fee5b060372099cedae72fde9ac47106a4;p=gc 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. --- 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;