summaryrefslogtreecommitdiff
path: root/rtems-test-template
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 21:29:00 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 21:29:00 +0000
commit9460b7e6a13fc7112f26666b0fcd22332f931df3 (patch)
tree1eae3e024d8de8d5e59a5cf45a689f4895957dac /rtems-test-template
parent24acc03bf917121fc08787a70b113505d4879e91 (diff)
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmtest_unblocking_nopreempt/init.c: Fix pattern.
Diffstat (limited to 'rtems-test-template')
-rw-r--r--rtems-test-template/ChangeLog4
-rw-r--r--rtems-test-template/psxtmtest_unblocking_nopreempt/init.c46
2 files changed, 21 insertions, 29 deletions
diff --git a/rtems-test-template/ChangeLog b/rtems-test-template/ChangeLog
index c010446..328d0ad 100644
--- a/rtems-test-template/ChangeLog
+++ b/rtems-test-template/ChangeLog
@@ -1,5 +1,9 @@
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * psxtmtest_unblocking_nopreempt/init.c: Fix pattern.
+
+2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* psxtest/init.c, psxtest_with_thread/init.c, psxtmtest_single/init.c,
smptest/init.c, sptest/init.c, sptest_operation_from_tsr/init.c,
sptest_with_task/init.c, tmtest/init.c: Switch to @TESTNUM@ for start
diff --git a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c b/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c
index 39e6857..7487108 100644
--- a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c
+++ b/rtems-test-template/psxtmtest_unblocking_nopreempt/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) /* XXX blocking operation goes here */
+ /* should never return */
+ rtems_test_assert( FALSE );
return NULL;
}
@@ -47,52 +38,49 @@ void *POSIX_Init(
void *argument
)
{
- int i;
int status;
pthread_t threadId;
long end_time;
- puts( "\n\n*** POSIX TIME TEST MUTEX @TESTNUM@ ***" );
+ puts( "\n\n*** POSIX TIME TEST XXX @TESTNUM@ ***" );
- 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 XXX after the threads. This way if the
* threads do run before we intend, they will get an error.
*/
- status = 0; /* XXX create the resource */
+ status = 0; /* XXX create resource */
rtems_test_assert( status == 0 );
/*
* Ensure the mutex is unavailable so the other threads block.
*/
- status = 0; /* XXX ensure the resource is unavailable so the threads block */
+ status = 0; /* XXX lock resource to ensure thread blocks */
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 = 0; /* XXX release the resource */
+ status = 0; /* XXX unblocking operation goes here */
end_time = benchmark_timer_read();
rtems_test_assert( status == 0 );
put_time(
- "@DESC@",
+ "@DESC",
end_time,
- OPERATION_COUNT,
+ 1,
0,
0
);
- puts( "*** END OF POSIX TIME TEST MUTEX @TESTNUM@ ***" );
+ puts( "*** END OF POSIX TIME TEST XXX @TESTNUM@ ***" );
rtems_test_exit( 0 );
return NULL;
@@ -103,8 +91,8 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
-#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 1
-/* XXX configure one of the resources */
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
+/* XXX make sure you configure the resource */
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT