src/kernel/task/threads.c
/**
 * @note zombie self thread.
 *       when a process is exit,set it to zombie.
 */
@note zombie self thread.
when a process is exit,set it to zombie.
@note zombie self thread . when a process is exit set it to zombie .
void zombie_self(){
    base_t level = intrLock_lock(&zombie_link_lock);
    thread_t * self_thread = GET_RUNNING_THREAD();
    scheduler_remove_self();
    threads_set_status(self_thread,THREADS_ZOMBIE);
    link_add_tail(&zombie_link, &self_thread->node);
    intrLock_unlock(&zombie_link_lock, level);
}
void zombie_self ( ) { base_t level = intrLock_lock ( & zombie_link_lock ) ; thread_t * self_thread = GET_RUNNING_THREAD ( ) ; scheduler_remove_self ( ) ; threads_set_status ( self_thread , THREADS_ZOMBIE ) ; link_add_tail ( & zombie_link , & self_thread -> node ) ; intrLock_unlock ( & zombie_link_lock , level ) ; }
@note zombie self thread.
@note zombie self thread .
// can`t hold any spinlock when blocked.