Module: xenomai-forge
Branch: next
Commit: 4b506e25b69dd726af3e0c917f14005a7e80ee25
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4b506e25b69dd726af3e0c917f14005a7e80ee25

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jul  6 14:39:14 2014 +0200

copperplate/threadobj: fix highest priority level for threads

---

 lib/copperplate/threadobj.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 44b7cd9..b5ce3d1 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -242,6 +242,8 @@ static inline void threadobj_set_agent(struct threadobj 
*thobj)
 
 static inline void pkg_init_corespec(void)
 {
+       threadobj_irq_prio = __RT(sched_get_priority_max(SCHED_CORE));
+       threadobj_high_prio = __RT(sched_get_priority_max(SCHED_FIFO));
 }
 
 static inline int threadobj_init_corespec(struct threadobj *thobj)
@@ -544,8 +546,9 @@ static inline void pkg_init_corespec(void)
         * holding the scheduler lock, unless the latter has to block
         * for some reason, defeating the purpose of such lock anyway.
         */
-       threadobj_lock_prio = threadobj_high_prio;
-       threadobj_high_prio = threadobj_lock_prio - 1;
+       threadobj_irq_prio = __RT(sched_get_priority_max(SCHED_FIFO));
+       threadobj_lock_prio = threadobj_irq_prio - 1;
+       threadobj_high_prio = threadobj_irq_prio - 2;
 
        memset(&sa, 0, sizeof(sa));
        sa.sa_handler = unblock_sighandler;
@@ -1581,12 +1584,9 @@ static inline int main_overlay(void)
 
 int threadobj_pkg_init(void)
 {
-       threadobj_irq_prio = __RT(sched_get_priority_max(SCHED_CORE));
-       threadobj_high_prio = threadobj_irq_prio - 1;
-       threadobj_agent_prio = threadobj_high_prio;
        sigaddset(&sigperiod_set, SIGPERIOD);
-
        pkg_init_corespec();
+       threadobj_agent_prio = threadobj_high_prio;
        start_agent();
 
        return main_overlay();


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

Reply via email to