stack_sentinel: remove check in _new_thread

We already check the stack sentinel for outgoing thread when we _Swap,
just leverage that.

The thread state check in _check_stack_sentinel now only exits if the
current thread is a dummy thread.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-09-12 11:47:18 -07:00 committed by Andrew Boie
commit 26d1eb38e6

View file

@ -143,7 +143,6 @@ void _thread_monitor_exit(struct k_thread *thread)
* 1) In k_yield() if the current thread is not swapped out
* 2) After servicing a non-nested interrupt
* 3) In _Swap(), check the sentinel in the outgoing thread
* 4) When a thread returns from its entry function to cooperatively terminate
*
* Item 2 requires support in arch/ code.
*
@ -154,10 +153,7 @@ void _check_stack_sentinel(void)
{
u32_t *stack;
if (_is_thread_prevented_from_running(_current)) {
/* Filter out threads that are dummy threads or already
* marked for termination (_THREAD_DEAD)
*/
if (_current->base.thread_state == _THREAD_DUMMY) {
return;
}
@ -185,9 +181,6 @@ FUNC_NORETURN void _thread_entry(k_thread_entry_t entry,
{
entry(p1, p2, p3);
#ifdef CONFIG_STACK_SENTINEL
_check_stack_sentinel();
#endif
#ifdef CONFIG_MULTITHREADING
k_thread_abort(k_current_get());
#else