summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtmtests/psxtmthread05
diff options
context:
space:
mode:
authorDaniel Ramirez <javamonn@gmail.com>2013-11-27 17:56:53 -0600
committerGedare Bloom <gedare@rtems.org>2013-11-27 20:50:10 -0500
commite9a1c991fed671cb7b22f059d6ca72693558ef44 (patch)
treeb17bab1710568af9e7acecd23e3e59c32e275dab /testsuites/psxtmtests/psxtmthread05
parentadd --enable-paravirt to the configure options (diff)
downloadrtems-e9a1c991fed671cb7b22f059d6ca72693558ef44.tar.bz2
psxtmtests: copy psxtmthread05 to psxtmthread06, fix psxtmthread05
The psxtmthread05 test was testing the functionality meant for psxtmthread06. This patch copies the psxtmthread05 to psxtmthread06 and modifies psxtmthread05 to test the intended functionality.
Diffstat (limited to 'testsuites/psxtmtests/psxtmthread05')
-rw-r--r--testsuites/psxtmtests/psxtmthread05/.cvsignore2
-rw-r--r--testsuites/psxtmtests/psxtmthread05/init.c10
-rw-r--r--testsuites/psxtmtests/psxtmthread05/psxtmthread05.doc6
3 files changed, 8 insertions, 10 deletions
diff --git a/testsuites/psxtmtests/psxtmthread05/.cvsignore b/testsuites/psxtmtests/psxtmthread05/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmthread05/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtmtests/psxtmthread05/init.c b/testsuites/psxtmtests/psxtmthread05/init.c
index 78f0465c70..11c84c526c 100644
--- a/testsuites/psxtmtests/psxtmthread05/init.c
+++ b/testsuites/psxtmtests/psxtmthread05/init.c
@@ -2,7 +2,6 @@
* COPYRIGHT (c) 1989-2012.
* On-Line Applications Research Corporation (OAR).
* COPYRIGHT (c) 2013.
- * Chirayu Desai (chirayudesai1@gmail.com).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -37,14 +36,16 @@ void benchmark_pthread_setschedparam(void)
/* make test_thread equal to POSIX_Init() */
pthread_getschedparam(pthread_self(), &policy, &param);
+
pthread_setschedparam(thread_ID, policy, &param);
/* At this point, we've switched to test_thread */
/* Back from test_thread, switch to test_thread again */
- param.sched_priority = sched_get_priority_max(policy) - 1;
+ param.sched_priority = sched_get_priority_min(policy);
benchmark_timer_initialize();
- pthread_setschedparam(thread_ID, policy, &param);
+ //lower own priority to minimun, scheduler forces an involuntary context switch
+ pthread_setschedparam(pthread_self(), policy, &param);
}
void *test_thread(
@@ -52,12 +53,9 @@ void *test_thread(
)
{
long end_time;
-
- /* switch to POSIX_Init */
sched_yield();
end_time = benchmark_timer_read();
-
put_time(
"pthread_setschedparam - lower own priority, preempt",
end_time,
diff --git a/testsuites/psxtmtests/psxtmthread05/psxtmthread05.doc b/testsuites/psxtmtests/psxtmthread05/psxtmthread05.doc
index 95724d04df..dbbd7b4446 100644
--- a/testsuites/psxtmtests/psxtmthread05/psxtmthread05.doc
+++ b/testsuites/psxtmtests/psxtmthread05/psxtmthread05.doc
@@ -1,7 +1,5 @@
# COPYRIGHT (c) 1989-2011.
# On-Line Applications Research Corporation (OAR).
-# COPYRIGHT (c) 2013.
-# Chirayu Desai (chirayudesai1@gmail.com).
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
@@ -22,5 +20,5 @@ directives:
+ pthread_setschedparam
concepts:
-
-+ Benchmark the call pthread_setschedparam while lowering the priority.
++ Benchmark the call pthread_setschedparam for lowering own priority and the
+ resulting involuntary context switch.