summaryrefslogtreecommitdiffstats
path: root/c/src/tests
diff options
context:
space:
mode:
authorMark Johannes <Mark.Johannes@OARcorp.com>1996-08-12 21:49:54 +0000
committerMark Johannes <Mark.Johannes@OARcorp.com>1996-08-12 21:49:54 +0000
commitaad3fe61d7d492bbb157c74d9f055f644b032d28 (patch)
treebab8479b31e251d61f5b5836d982b4e4fa2406ed /c/src/tests
parentTask2: new task for broadcast case (diff)
downloadrtems-aad3fe61d7d492bbb157c74d9f055f644b032d28.tar.bz2
Init.c: added cases for signal, wait and broadcast
Diffstat (limited to 'c/src/tests')
-rw-r--r--c/src/tests/psxtests/psx10/init.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/c/src/tests/psxtests/psx10/init.c b/c/src/tests/psxtests/psx10/init.c
index de04bcdd82..0c679a2441 100644
--- a/c/src/tests/psxtests/psx10/init.c
+++ b/c/src/tests/psxtests/psx10/init.c
@@ -81,9 +81,6 @@ void *POSIX_Init(
assert( status == EINVAL );
puts( "Init: pthread_condattr_getpshared - EINVAL" );
- Init_id = pthread_self();
- printf( "Init: ID is 0x%08x\n", Init_id );
-
puts( "Init: pthread_cond_init - NULL attr" );
status = pthread_cond_init( &cond, NULL );
assert( !status );
@@ -93,15 +90,37 @@ void *POSIX_Init(
assert( !status );
puts( "Init: pthread_cond_init - attr" );
- status = pthread_cond_init( &cond, &attr );
+ status = pthread_cond_init( &Cond1_id, &attr );
assert( !status );
/* create a thread */
-/*
- status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
+ empty_line();
+
+ status = pthread_create( &Task_id, NULL, Task_1, NULL );
+ assert( !status );
+
+ puts( "Init: sleep to switch to Task_1" );
+ sleep( 1 );
+
+ puts( "Init: pthread_cond_signal" );
+ status = pthread_cond_signal( &Cond1_id );
+ assert( !status );
+
+ empty_line();
+
+ status = pthread_create( &Task2_id, NULL, Task_2, NULL );
+ assert( !status );
+
+ puts( "Init: sleep - switch to Task_1 and Task_2" );
+ sleep( 1 );
+
+ puts( "Init: pthread_cond_broadcast" );
+ status = pthread_cond_broadcast( &Cond1_id );
assert( !status );
-*/
+
+ puts( "Init: sleep - switch to Task_1" );
+ sleep( 1 );
/* exit this thread */