diff --git a/conts/posix/mm0/main.c b/conts/posix/mm0/main.c index 828c275..9cd0157 100644 --- a/conts/posix/mm0/main.c +++ b/conts/posix/mm0/main.c @@ -140,6 +140,14 @@ void handle_requests(void) break; } case L4_IPC_TAG_EXIT: { + /* Zombie test for kernel + struct task_ids ids; + + l4_getid(&ids); + + printf("\n%s: Destroying self (%d), along with any tasks.\n", __TASKNAME__, self_tid()); + l4_thread_control(THREAD_DESTROY, &ids); + */ /* An exiting task has no receive phase */ sys_exit(sender, (int)mr[0]); return; @@ -187,17 +195,11 @@ void handle_requests(void) void main(void) { - struct task_ids ids; - - l4_getid(&ids); printf("\n%s: Started with thread id %d\n", __TASKNAME__, self_tid()); init(); - printf("\n%s: Destroying self (%d), along with any tasks.\n", __TASKNAME__, self_tid()); - l4_thread_control(THREAD_DESTROY, &ids); - printf("%s: Memory/Process manager initialized. Listening requests.\n", __TASKNAME__); while (1) { handle_requests(); diff --git a/src/api/thread.c b/src/api/thread.c index 1f65dc4..454d6c9 100644 --- a/src/api/thread.c +++ b/src/api/thread.c @@ -171,8 +171,6 @@ void task_make_zombie(struct ktcb *task) wake_up_all(&task->wqh_send, 0); wake_up_all(&task->wqh_recv, 0); - printk("Thread (%d) becoming zombie. (Current: (%d))\n", task->tid, current->tid); - BUG_ON(!(task->flags & TASK_EXITING)); /* Add to zombie list, to be destroyed later */ @@ -221,7 +219,6 @@ int task_resume(struct ktcb *task) return 0; } - /* Runs a thread for the first time */ int thread_start(struct task_ids *ids) { @@ -434,8 +431,6 @@ static inline int thread_destroy(struct task_ids *ids) { struct ktcb *task; - printk("%s: Destroying (%d)\n", __FUNCTION__, ids->tid); - if (!(task = tcb_find(ids->tid))) return -ESRCH;