kernel: mem_domain: Add arch specfic destroy for remove thread API.

If the thread id is same as current then handle the cleanup of the
memory domain.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
Adithya Baglody 2017-11-20 13:40:14 +05:30 committed by Andrew Boie
commit e1f4a002f3

View file

@ -168,6 +168,9 @@ void k_mem_domain_remove_thread(k_tid_t thread)
__ASSERT(thread && thread->mem_domain_info.mem_domain, "");
key = irq_lock();
if (_current == thread) {
_arch_mem_domain_destroy(thread->mem_domain_info.mem_domain);
}
sys_dlist_remove(&thread->mem_domain_info.mem_domain_q_node);
thread->mem_domain_info.mem_domain = NULL;