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

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 00d6c41..af86783 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