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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Sep  9 10:44:20 2012 +0200

nucleus/shadow: do not clear PIP boost for an exiting thread

When a shadow thread is running the linux-side task exit code, we must
not attempt to de-boost it, in case it holds a contended PIP-managed
synchronization object.

Not only resetting the priority of a terminating thread is useless,
but since that thread will clear its own struct_task backlink _before_
de-boosting itself, there is no way to send and process a lostage
renice request for it.

We now check for the zombie state of the de-boosted thread, to prevent
priority update if set.

---

 ksrc/nucleus/pod.c   |    4 ++--
 ksrc/nucleus/synch.c |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 5f53002..1f4a749 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -1187,12 +1187,12 @@ void xnpod_delete_thread(xnthread_t *thread)
        if (xnthread_test_state(thread, XNPEND))
                xnsynch_forget_sleeper(thread);
 
+       xnthread_set_state(thread, XNZOMBIE);
+
        xnsynch_release_all_ownerships(thread);
 
        __xnpod_giveup_fpu(sched, thread);
 
-       xnthread_set_state(thread, XNZOMBIE);
-
        if (sched->curr == thread) {
                /*
                 * We first need to pick a new curr before
diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c
index 695824e..e10be47 100644
--- a/ksrc/nucleus/synch.c
+++ b/ksrc/nucleus/synch.c
@@ -608,7 +608,8 @@ static void xnsynch_clear_boost(struct xnsynch *synch,
                        target = owner;
        }
 
-       if (w_cprio(owner) != wprio)
+       if (w_cprio(owner) != wprio &&
+           !xnthread_test_state(owner, XNZOMBIE))
                xnsynch_renice_thread(owner, target);
 }
 


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

Reply via email to