diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-20 21:30:02 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-20 21:30:02 +0000 |
commit | b499cb7a6045ec92c2e22d635ced448a52c91b3c (patch) | |
tree | 0269c8f5b979802d15925fc0628db376e4c062a8 /testsuites/psxtmtests/psxtmmutex05/init.c | |
parent | 2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-b499cb7a6045ec92c2e22d635ced448a52c91b3c.tar.bz2 |
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmmutex05/init.c: Fix test. Pattern was wrong.
Diffstat (limited to '')
-rw-r--r-- | testsuites/psxtmtests/psxtmmutex05/init.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/testsuites/psxtmtests/psxtmmutex05/init.c b/testsuites/psxtmtests/psxtmmutex05/init.c index 5f39743df2..05caa310d6 100644 --- a/testsuites/psxtmtests/psxtmmutex05/init.c +++ b/testsuites/psxtmtests/psxtmmutex05/init.c @@ -23,22 +23,13 @@ pthread_mutex_t MutexId; -void *Blockers( +void *Blocker( void *argument ) { - int status; - - /* - * Now we have finished the thread startup overhead, - * so let other threads run. When we return, we can - * finish the benchmark. - */ - sched_yield(); - /* let other threads run */ - - status = pthread_mutex_lock( &MutexId ); - rtems_test_assert( status == 0 ); + (void) pthread_mutex_lock( &MutexId ); + /* should never return */ + rtems_test_assert( FALSE ); return NULL; } @@ -47,17 +38,14 @@ void *POSIX_Init( void *argument ) { - int i; int status; pthread_t threadId; long end_time; puts( "\n\n*** POSIX TIME TEST MUTEX 05 ***" ); - for ( i=0 ; i < OPERATION_COUNT ; i++ ) { - status = pthread_create( &threadId, NULL, Blockers, NULL ); - rtems_test_assert( status == 0 ); - } + status = pthread_create( &threadId, NULL, Blocker, NULL ); + rtems_test_assert( status == 0 ); /* * Deliberately create the mutex after the threads. This way if the @@ -73,11 +61,11 @@ void *POSIX_Init( rtems_test_assert( status == 0 ); /* - * Let the other threads start so the thread startup overhead, + * Let the other thread start so the thread startup overhead, * is accounted for. When we return, we can start the benchmark. */ sched_yield(); - /* let other threads run */ + /* let other thread run */ benchmark_timer_initialize(); status = pthread_mutex_unlock( &MutexId ); @@ -87,7 +75,7 @@ void *POSIX_Init( put_time( "pthread_mutex_unlock (no preemption)", end_time, - OPERATION_COUNT, + 1, 0, 0 ); @@ -103,7 +91,7 @@ void *POSIX_Init( #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 1 +#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1 #define CONFIGURE_POSIX_INIT_THREAD_TABLE |