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:
parent
4a9a4240c6
commit
885fcd5147
2 changed files with 12 additions and 15 deletions
|
@ -431,20 +431,6 @@ static inline void _ready_thread(struct k_thread *thread)
|
||||||
#endif
|
#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
|
* Set a thread's priority. If the thread is ready, place it in the correct
|
||||||
* queue.
|
* queue.
|
||||||
|
|
|
@ -447,7 +447,18 @@ void _k_thread_single_abort(struct k_thread *thread)
|
||||||
_abort_thread_timeout(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
|
#ifdef CONFIG_MULTITHREADING
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue