kernel: fix bit clearing logic in _k_thread_group_leave

Fix init_group bit clearing in _k_thread_group_leave()

Fix _k_object_uninit calling order. Though the order won't
make much difference in this case it is always good to destroy
or uninitialize in the reverse order of the object creation or
initialization.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This commit is contained in:
Ramakrishna Pallala 2017-10-25 13:15:52 -04:00 committed by Andrew Boie
commit 1777c57bec

View file

@ -577,8 +577,8 @@ void _k_thread_single_abort(struct k_thread *thread)
/* 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);
_k_object_uninit(thread->stack_obj);
_k_object_uninit(thread);
if (thread->base.perm_index != -1) {
free_thread_index(thread->base.perm_index);
@ -689,7 +689,7 @@ void _k_thread_group_leave(u32_t groups, struct k_thread *thread)
{
struct _static_thread_data *thread_data = thread->init_data;
thread_data->init_groups &= groups;
thread_data->init_groups &= ~groups;
}
void k_thread_access_grant(struct k_thread *thread, ...)