mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
The thread is now supposed to be created.
This commit is contained in:
parent
0b8f25bbca
commit
22347a8b23
@ -1,5 +1,5 @@
|
|||||||
/* Test for notification mechanism in lio_listio.
|
/* Test for notification mechanism in lio_listio.
|
||||||
Copyright (C) 2000,02 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2002, 2006 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -24,13 +24,18 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
int flag;
|
static pthread_barrier_t b;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
thrfct (sigval_t arg)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -52,6 +57,12 @@ do_test (int argc, char *argv[])
|
|||||||
|
|
||||||
unlink (name);
|
unlink (name);
|
||||||
|
|
||||||
|
if (pthread_barrier_init (&b, NULL, 2) != 0)
|
||||||
|
{
|
||||||
|
puts ("barrier_init failed");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
arr[0] = &cb;
|
arr[0] = &cb;
|
||||||
|
|
||||||
cb.aio_fildes = fd;
|
cb.aio_fildes = fd;
|
||||||
@ -82,9 +93,10 @@ do_test (int argc, char *argv[])
|
|||||||
return 1;
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user