Module: xenomai-3
Branch: next
Commit: 9974f1359394888ad3a3b75cdbd67234fbe8fb93
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9974f1359394888ad3a3b75cdbd67234fbe8fb93

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Nov  6 10:19:33 2014 +0100

cobalt/posix/thread: fix pthread_getschedparam() for RR threads

f15920c67 introduced a regression, causing round-robin threads to
receive SCHED_FIFO instead of SCHED_RR upon inquiry for schedparams.

---

 kernel/cobalt/posix/thread.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index e441371..3ab20f6 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -301,8 +301,10 @@ pthread_getschedparam_ex(struct cobalt_thread *thread,
                *policy_r = SCHED_NORMAL;
 
        if (base_class == &xnsched_class_rt) {
-               if (xnthread_test_state(base_thread, XNRRB))
+               if (xnthread_test_state(base_thread, XNRRB)) {
                        ns2ts(&param_ex->sched_rr_quantum, 
base_thread->rrperiod);
+                       *policy_r = SCHED_RR;
+               }
                goto unlock_and_exit;
        }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to