Fix initsecondarythread_test runtime failure if GC compiled w/o threads
authorIvan Maidanski <ivmai@mail.ru>
Sat, 19 Nov 2016 17:02:25 +0000 (20:02 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 19 Nov 2016 17:02:25 +0000 (20:02 +0300)
Now the test should fail during its linking if a single-threaded libgc
is used (this should not happen in case of configure/make).

* tests/initsecondarythread.c (main): Call GC_get_parallel() to ensure
that libgc is compiled with the threads support.

tests/initsecondarythread.c

index 5f21405..73cc298 100644 (file)
@@ -74,6 +74,7 @@ int main(void)
     /* GC_INIT() must be called from main thread only. */
     GC_INIT();
 # endif
+  (void)GC_get_parallel(); /* linking fails if no threads support */
 # ifdef GC_PTHREADS
     if ((code = pthread_create (&t, NULL, thread, NULL)) != 0) {
       fprintf(stderr, "Thread creation failed %d\n", code);