9 static pthread_barrier_t b;
10 static pthread_t main_thread;
17 int e = pthread_barrier_wait (&b);
18 if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
20 puts ("child: barrier_wait failed");
24 /* There is unfortunately no other way to try to make sure the other
25 thread reached the aio_suspend call. This test could fail on
26 highly loaded machines. */
29 pthread_kill (main_thread, SIGUSR1);
48 main_thread = pthread_self ();
54 sigemptyset (&sa.sa_mask);
56 if (sigaction (SIGUSR1, &sa, NULL) != 0)
58 puts ("sigaction failed");
62 if (pthread_barrier_init (&b, NULL, 2) != 0)
64 puts ("barrier_init");
77 req.aio_fildes = fds[0];
81 req.aio_nbytes = sizeof (buf);
82 req.aio_sigevent.sigev_notify = SIGEV_NONE;
84 if (aio_read (&req) != 0)
86 puts ("aio_read failed");
91 if (pthread_create (&th, NULL, tf, NULL) != 0)
93 puts ("create failed");
97 int e = pthread_barrier_wait (&b);
98 if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
100 puts ("parent: barrier_wait failed");
104 const struct aiocb *list[1];
107 e = aio_suspend (list, 1, NULL);
110 puts ("aio_suspend succeeded");
115 puts ("aio_suspend did not return EINTR");
122 #define TEST_FUNCTION do_test ()
124 #include "../test-skeleton.c"