]> granicus.if.org Git - gc/commitdiff
Allow subthreadcreate_test to be compiled with zero NTHREADS
authorIvan Maidanski <ivmai@mail.ru>
Tue, 10 Apr 2018 21:26:09 +0000 (00:26 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 10 Apr 2018 21:55:37 +0000 (00:55 +0300)
* 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

index af74e14f15142021733fa179b66284d46f65c670..5d9c831d04b098ca241a6dfb4addfb24c58ec5f6 100644 (file)
@@ -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;