[ Enhanced version, removing more unneeded code. ]

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 a reschedule. Drop the related code.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---

 ksrc/nucleus/shadow.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index e2f2968..1f90054 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,9 +2192,10 @@ 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();
+
+       /* The deleted thread was suspended (relaxed), so there is no need for
+          reschedule. */
 
        xnshadow_dereference_skin(magic);
        trace_mark(xn_nucleus, shadow_exit, "thread %p thread_name %s",


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

Reply via email to