summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx07/task.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 14:55:24 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 14:55:24 +0000
commit712726d3df9965ddf15e9e9d61af79268a453e3a (patch)
treececf989ca45babe0c7be421f22d91480064790b7 /testsuites/psxtests/psx07/task.c
parent2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-712726d3df9965ddf15e9e9d61af79268a453e3a.tar.bz2
2009-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* psx07/init.c, psx07/psx07.scn, psx07/system.h, psx07/task.c: Update test to reflect not allowing poriority changes when mutex is locked.
Diffstat (limited to 'testsuites/psxtests/psx07/task.c')
-rw-r--r--testsuites/psxtests/psx07/task.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx07/task.c b/testsuites/psxtests/psx07/task.c
index 417eb5bdfc..281436f500 100644
--- a/testsuites/psxtests/psx07/task.c
+++ b/testsuites/psxtests/psx07/task.c
@@ -31,3 +31,36 @@ void *Task_1(
return NULL; /* just so the compiler thinks we returned something */
}
+
+void *Task_2(
+ void *argument
+)
+{
+ int i = 0;
+ time_t now, start;
+
+ /*
+ * Change our priority so we are running at a logically higher
+ * priority than our "ss_high_priority". This should result in
+ * our replenishment period not touching our priority.
+ */
+
+ /*
+ * Consume time so the cpu budget callout will run.
+ *
+ * DO NOT BLOCK!!!
+ */
+ start = time(&start);
+ while( i <= 10 ) {
+ do {
+ now = time(&now);
+ } while (start == now);
+ start = time(&start);
+
+ printf( "Time elapsed Task_2: %2d (seconds)\n", i++ );
+ }
+
+ puts( "Task_2 - exitting" );
+ pthread_exit( NULL );
+ return NULL;
+}