From 2197a2e15fa57bbc7a6f2bfe3d00a75860fbaa82 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 29 May 1996 20:56:57 +0000 Subject: simple version of test which shows pthread_create, pthread_exit, and exit are basically working. This test will be enhanced further. --- c/src/tests/psxtests/psx01/init.c | 11 ++++++++++- c/src/tests/psxtests/psx01/system.h | 5 +++-- c/src/tests/psxtests/psx01/task.c | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'c') diff --git a/c/src/tests/psxtests/psx01/init.c b/c/src/tests/psxtests/psx01/init.c index 5605f9fff0..3469f3f7b4 100644 --- a/c/src/tests/psxtests/psx01/init.c +++ b/c/src/tests/psxtests/psx01/init.c @@ -25,10 +25,12 @@ #define CONFIGURE_INIT #include "system.h" -void Init( +void *Init( void *argument ) { + int status; + pthread_t thread_id; puts( "\n\n*** POSIX TEST 1 ***" ); @@ -38,5 +40,12 @@ void Init( /* exit */ + status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); + assert( !status ); + pthread_exit( NULL ); + + /* just to satisfy compilers which think we did not return anything */ + + return NULL; } diff --git a/c/src/tests/psxtests/psx01/system.h b/c/src/tests/psxtests/psx01/system.h index 75433a7ee7..0868489f9a 100644 --- a/c/src/tests/psxtests/psx01/system.h +++ b/c/src/tests/psxtests/psx01/system.h @@ -18,13 +18,14 @@ #include #include +#include #include -void Init( +void *Init( void *argument ); -void Task_1_through_3( +void *Task_1_through_3( void *argument ); diff --git a/c/src/tests/psxtests/psx01/task.c b/c/src/tests/psxtests/psx01/task.c index f6f365ab51..02678aa31c 100644 --- a/c/src/tests/psxtests/psx01/task.c +++ b/c/src/tests/psxtests/psx01/task.c @@ -21,12 +21,17 @@ #include "system.h" -void Task_1_through_3( +void *Task_1_through_3( void *argument ) { int seconds; + /* XXX temporary */ + + puts( "*** END OF POSIX TEST 1 ***" ); + exit( 0 ); + for ( ; ; ) { /* grab the tod */ -- cgit v1.2.3