[ Updated according to discussion. ] xnshadow_relax is no longer needed as do_exit, the caller of this hook, always runs in secondary mode, ie. over the ROOT thread. Enforce this assumptions by leaving a XENO_BUGON behind.
And as the target thread is relaxed already, ie. suspended, there is also no need for explicit reschedule. But keep xnpod_schedule for the case the exit hook caused a prio change to the ROOT thread. Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- ksrc/nucleus/shadow.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index e2f2968..416e675 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -2179,12 +2179,11 @@ static inline void do_taskexit_event(struct task_struct *p) if (!thread) return; + XENO_BUGON(NUCLEUS, !xnpod_root_p()); + if (xnthread_test_state(thread, XNDEBUG)) unlock_timers(); - if (xnpod_shadow_p()) - xnshadow_relax(0); - magic = xnthread_get_magic(thread); xnlock_get_irqsave(&nklock, s); @@ -2193,7 +2192,6 @@ static inline void do_taskexit_event(struct task_struct *p) xnthread_archtcb(thread)->user_task = NULL; /* xnpod_delete_thread() -> hook -> xnshadow_unmap(). */ xnpod_delete_thread(thread); - xnsched_set_resched(thread->sched); xnlock_put_irqrestore(&nklock, s); xnpod_schedule(); _______________________________________________ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core