mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-06 14:30:38 +08:00
* winsup.api/pthread/cancel9.c: Wait in mainthread until child process has terminated.
This commit is contained in:
parent
b8838e6f75
commit
00d1a4bb20
@ -1,3 +1,8 @@
|
|||||||
|
2003-01-21 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
|
* winsup.api/pthread/cancel9.c: Wait in mainthread until child
|
||||||
|
process has terminated.
|
||||||
|
|
||||||
2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
|
2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
* winsup.api/pthread/cancel10.c: New test.
|
* winsup.api/pthread/cancel10.c: New test.
|
||||||
|
@ -41,11 +41,13 @@
|
|||||||
|
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
|
static pid_t pid;
|
||||||
|
|
||||||
static void *Thread(void *punused)
|
static void *Thread(void *punused)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
pid_t pid = fork ();
|
|
||||||
|
|
||||||
|
pid = fork ();
|
||||||
assert (pid != -1);
|
assert (pid != -1);
|
||||||
switch (pid)
|
switch (pid)
|
||||||
{
|
{
|
||||||
@ -61,6 +63,8 @@ static void *Thread(void *punused)
|
|||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
void * result;
|
void * result;
|
||||||
pthread_t t;
|
pthread_t t;
|
||||||
|
|
||||||
@ -69,6 +73,7 @@ int main (void)
|
|||||||
assert (pthread_cancel (t) == 0);
|
assert (pthread_cancel (t) == 0);
|
||||||
assert (pthread_join (t, &result) == 0);
|
assert (pthread_join (t, &result) == 0);
|
||||||
assert (result == PTHREAD_CANCELED);
|
assert (result == PTHREAD_CANCELED);
|
||||||
|
assert (waitpid (pid, &res, 0) != -1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user