userspace: de-initialize aborted threads

This will allow these thread objects to be re-used.

_mark_thread_as_dead() removed, it was only being called in one
place.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-10-05 14:37:59 -07:00 committed by Andrew Boie
commit 885fcd5147
2 changed files with 12 additions and 15 deletions

View file

@ -431,20 +431,6 @@ static inline void _ready_thread(struct k_thread *thread)
#endif
}
/**
* @brief Mark thread as dead
*
* This routine must be called with interrupts locked.
*/
static inline void _mark_thread_as_dead(struct k_thread *thread)
{
thread->base.thread_state |= _THREAD_DEAD;
#ifdef CONFIG_KERNEL_EVENT_LOGGER_THREAD
_sys_k_event_logger_thread_exit(thread);
#endif
}
/*
* Set a thread's priority. If the thread is ready, place it in the correct
* queue.

View file

@ -447,7 +447,18 @@ void _k_thread_single_abort(struct k_thread *thread)
_abort_thread_timeout(thread);
}
}
_mark_thread_as_dead(thread);
thread->base.thread_state |= _THREAD_DEAD;
#ifdef CONFIG_KERNEL_EVENT_LOGGER_THREAD
_sys_k_event_logger_thread_exit(thread);
#endif
#ifdef CONFIG_USERSPACE
/* Clear initailized state so that this thread object may be re-used
* and triggers errors if API calls are made on it from user threads
*/
_k_object_uninit(thread);
#endif
}
#ifdef CONFIG_MULTITHREADING