summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtmtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 21:30:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 21:30:02 +0000
commitb499cb7a6045ec92c2e22d635ced448a52c91b3c (patch)
tree0269c8f5b979802d15925fc0628db376e4c062a8 /testsuites/psxtmtests
parent2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-b499cb7a6045ec92c2e22d635ced448a52c91b3c.tar.bz2
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmmutex05/init.c: Fix test. Pattern was wrong.
Diffstat (limited to 'testsuites/psxtmtests')
-rw-r--r--testsuites/psxtmtests/ChangeLog4
-rw-r--r--testsuites/psxtmtests/psxtmmutex05/init.c32
2 files changed, 14 insertions, 22 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog
index 4ff60be620..609d963ab9 100644
--- a/testsuites/psxtmtests/ChangeLog
+++ b/testsuites/psxtmtests/ChangeLog
@@ -1,5 +1,9 @@
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * psxtmmutex05/init.c: Fix test. Pattern was wrong.
+
+2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* Makefile.am, configure.ac: Add benchmark of pthread_mutex_unlock
where it is unblocking threads without preemption.
* psxtmmutex05/.cvsignore, psxtmmutex05/Makefile.am,
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