Commit a97cf34b authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/posix: fix missed rescheduling opportunities

stop_debugged_thread() may suspend threads running on a remote CPU, we
have to kick the rescheduling procedure for these changes to take
effect asap. Make sure xnsched_run() is kicked from the call sites
once they are done updating the scheduler state.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent e91a0def
......@@ -819,6 +819,7 @@ static inline int handle_exception(struct ipipe_trap_data *d)
}
stop_debugged_process(thread);
xnlock_put_irqrestore(&nklock, s);
xnsched_run();
}
#endif
......@@ -1295,10 +1296,8 @@ static int handle_sigwake_event(struct task_struct *p)
cobalt_register_debugged_thread(thread);
}
if (xnthread_test_state(thread, XNRELAX)) {
xnlock_put_irqrestore(&nklock, s);
return KEVENT_PROPAGATE;
}
if (xnthread_test_state(thread, XNRELAX))
goto out;
/*
* If kicking a shadow thread in primary mode, make sure Linux
......@@ -1320,7 +1319,7 @@ static int handle_sigwake_event(struct task_struct *p)
xnthread_resume(thread, XNDBGSTOP);
__xnthread_kick(thread);
out:
xnsched_run();
xnlock_put_irqrestore(&nklock, s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment