summaryrefslogtreecommitdiff
path: root/rtkaio/tst-aiod2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-09-07 16:06:55 +0000
committerJakub Jelinek <jakub@redhat.com>2006-09-07 16:06:55 +0000
commitb2adc86677d215d3d8071393d2a69357dd844821 (patch)
treeff42a4bcece19ef14c90ff3ffa4b102b80b455ed /rtkaio/tst-aiod2.c
parenteaa2ea12a27561393da77bcf435dad34d84d3e14 (diff)
* tst-aiod2.c: Adjust test for new semantics of lio_listio.
* tst-aiod3.c: The thread is now supposed to be created.
Diffstat (limited to 'rtkaio/tst-aiod2.c')
-rw-r--r--rtkaio/tst-aiod2.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/rtkaio/tst-aiod2.c b/rtkaio/tst-aiod2.c
index a17e9e8ccf..c516797c71 100644
--- a/rtkaio/tst-aiod2.c
+++ b/rtkaio/tst-aiod2.c
@@ -26,13 +26,19 @@
#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);
+ }
}
@@ -54,6 +60,12 @@ do_test (int argc, char *argv[])
unlink (name);
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
arr[0] = &cb;
void *p;
@@ -99,9 +111,12 @@ do_test (int argc, char *argv[])
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;
}