8 static int do_test (void);
10 #define TEST_FUNCTION do_test ()
11 #include "../test-skeleton.c"
13 static pthread_barrier_t b
;
32 int e
= pthread_barrier_wait (&b
);
33 if (e
!= 0 && e
!= PTHREAD_BARRIER_SERIAL_THREAD
)
35 puts ("barrier_wait failed");
39 e
= pthread_create (&th
, NULL
, tf2
, NULL
);
42 printf ("create failed: %s\n", strerror (e
));
46 /* Terminate only this thread. */
56 if (pthread_barrier_init (&b
, NULL
, 2) != 0)
58 puts ("barrier_init failed");
62 int e
= pthread_create (&th
, NULL
, tf
, NULL
);
65 printf ("create failed: %s\n", strerror (e
));
69 e
= pthread_barrier_wait (&b
);
70 if (e
!= 0 && e
!= PTHREAD_BARRIER_SERIAL_THREAD
)
72 puts ("barrier_wait failed");
78 /* Terminate only this thread. */