From f87cce2ef8c1a732ecec7c6e0550cba80174fe77 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 19 Nov 2016 20:02:25 +0300 Subject: [PATCH] Fix initsecondarythread_test runtime failure if GC compiled w/o threads 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/initsecondarythread.c b/tests/initsecondarythread.c index 5f21405..73cc298 100644 --- a/tests/initsecondarythread.c +++ b/tests/initsecondarythread.c @@ -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); -- 2.7.4