From 2ef097640758653a0e9d63e90a4aac329cd86368 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 22 Feb 1999 02:54:12 +0000 Subject: 1999-02-23 Ross Johnson * Makefile: Some refinement. * *.c: More exhaustive checking through assertions; clean up; add some more tests. --- tests/exit2.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'tests/exit2.c') diff --git a/tests/exit2.c b/tests/exit2.c index 48ad5d0..786e4aa 100644 --- a/tests/exit2.c +++ b/tests/exit2.c @@ -1,12 +1,30 @@ /* * Test for pthread_exit(). + * + * Depends on API functions: + * pthread_create() + * pthread_exit() */ -#include +#include "test.h" + +void * +func(void * arg) +{ + pthread_exit(arg); + + /* Never reached. */ + exit(1); +} int main(int argc, char * argv[]) { - /* Should be the same as return 0; */ - pthread_exit(0); + pthread_t t; + + assert(pthread_create(&t, NULL, func, (void *) NULL) == 0); + + Sleep(2000); + + return 0; } -- cgit v1.2.3