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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Dec 14 12:17:23 2013 +0100

cobalt/thread: demote thread upon cancellation request

A thread which is sent a cancellation request might be held internally
by the scheduling policy it undergoes, in a way that would prevent it
from waking up for exiting. Typically, a SCHED_QUOTA thread with no
runtime budget at the time of the request would be prevented from
exiting.

To address this issue, we demote threads receiving a cancellation
request, which implies switching them out of primary mode, and moving
to the weak scheduling class, where it cannot be held.

---

 kernel/cobalt/thread.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index d05482f..5bf8f39 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -1535,7 +1535,7 @@ check_self_cancel:
                return;
        }
 
-       __xnshadow_kick(thread);
+       __xnshadow_demote(thread);
        xnsched_run();
 
 unlock_and_exit:


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

Reply via email to