diff options
author | rpj <rpj> | 1999-02-22 02:54:12 +0000 |
---|---|---|
committer | rpj <rpj> | 1999-02-22 02:54:12 +0000 |
commit | 2ef097640758653a0e9d63e90a4aac329cd86368 (patch) | |
tree | 71751f699b0aedba3227446ac228d30f2a127173 /tests/exit2.c | |
parent | 943bc9bb02212649a83ec32152299d50d34226e6 (diff) |
1999-02-23 Ross Johnson <rpj@ise.canberra.edu.au>
* Makefile: Some refinement.
* *.c: More exhaustive checking through assertions; clean up;
add some more tests.
Diffstat (limited to 'tests/exit2.c')
-rw-r--r-- | tests/exit2.c | 24 |
1 files changed, 21 insertions, 3 deletions
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 <pthread.h> +#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; } |