* tst-aiod3.c: The thread is now supposed to be created.
2006-09-07 Jakub Jelinek <jakub@redhat.com>
+ * tst-aiod2.c: Adjust test for new semantics of lio_listio.
+ * tst-aiod3.c: The thread is now supposed to be created.
+
* Makefile: Use $(..) in place of ../.
(tests): Add tst-aio{8,9,10}, tst-cpuclock{1,2}, tst-cputimer{1,2,3}
and tst-clock2.
#include <errno.h>
#include "tst-aiod.h"
-int flag;
+
+static pthread_barrier_t b;
static void
thrfct (sigval_t arg)
{
- flag = 1;
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("thread: barrier_wait failed");
+ exit (1);
+ }
}
unlink (name);
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
arr[0] = &cb;
void *p;
return 1;
}
- if (flag != 0)
+ puts ("lio_listio returned");
+
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("thread created, should not have happened");
+ puts ("barrier_wait failed");
return 1;
}
#include <errno.h>
#include "tst-aiod.h"
-int flag;
+
+static pthread_barrier_t b;
static void
thrfct (sigval_t arg)
{
- flag = 1;
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("child: barrier_wait failed");
+ exit (1);
+ }
}
unlink (name);
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
arr[0] = &cb;
void *p;
return 1;
}
- if (flag != 0)
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("thread created, should not have happened");
+ puts ("parent: barrier_wait failed");
return 1;
}