Module: xenomai-2.6
Branch: master
Commit: d9bd20eb747f2dc1611228ba877945ffe08448d2
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=d9bd20eb747f2dc1611228ba877945ffe08448d2

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat Jan 14 03:09:33 2012 +0100

posix: fix linux-side posix threads priority

xnshadow_map expects the thread being mapped to already have the
correct priority and policy on linux side if this thread does not
use the completion mechanism, in order to avoid sending a signal
which would cause a switch to secondary mode.

However, user-space posix skins start with the same priority as
their parent thread. The result is that, on Linux side, they keep
that wrong priority until their priority is synchronized for whatever
reason.

Fix this by explicitely changing priority on Linux side before emitting
the syscall that will result in a call to xnshadow_map.

---

 src/skins/posix/thread.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/skins/posix/thread.c b/src/skins/posix/thread.c
index b0e6695..5e9dc63 100644
--- a/src/skins/posix/thread.c
+++ b/src/skins/posix/thread.c
@@ -175,6 +175,8 @@ static void *__pthread_trampoline(void *arg)
        policy = iargs->policy;
        parent_prio = iargs->parent_prio;
 
+       __real_pthread_setschedparam(pthread_self(), policy, &param);
+
        /* Do _not_ inline the call to pthread_self() in the syscall
           macro: this trashes the syscall regs on some archs. */
        err = XENOMAI_SKINCALL4(__pse51_muxid, __pse51_thread_create, tid,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to