/* Always zero, used in breakpoint condition. */
volatile int global_zero;
+static pthread_barrier_t threads_started_barrier;
+
void *
child_function (void *arg)
{
+ pthread_barrier_wait (&threads_started_barrier);
+
while (1)
{
usleep (1); /* set breakpoint child here */
pthread_t child_thread;
int res;
+ pthread_barrier_init (&threads_started_barrier, NULL, 2);
+
res = pthread_create (&child_thread, NULL, child_function, NULL);
+
+ pthread_barrier_wait (&threads_started_barrier);
+
sleep (2); /* set wait-thread breakpoint here */
exit (EXIT_SUCCESS);
}