diff options
Diffstat (limited to 'kernel/proc/kthread.c')
-rw-r--r-- | kernel/proc/kthread.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/proc/kthread.c b/kernel/proc/kthread.c index 46dd627..fa447ae 100644 --- a/kernel/proc/kthread.c +++ b/kernel/proc/kthread.c @@ -99,6 +99,9 @@ kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1, list_init(&new_thread->kt_mutexes); new_thread->kt_recent_core = 0; + // put this thread on the process's thread list + list_insert_tail(&proc->p_threads, &new_thread->kt_plink); + dbg(DBG_THR, "SUCCESFULLY created a new THREAD with proc name=%s, id=%d\n", proc->p_name, proc->p_pid); return new_thread; @@ -160,6 +163,9 @@ void kthread_cancel(kthread_t *thr, void *retval) KASSERT(thr != curthr); // TODO: ask about the use of check_curthr_cancelled() in syscall_handler() + int status = (int) retval; + dbg(DBG_THR, "Cancelling thread with proc name=%s, id=%d, status=%d\n", + thr->kt_proc->p_name, thr->kt_proc->p_pid, status); thr->kt_retval = retval; sched_cancel(thr); @@ -172,6 +178,7 @@ void kthread_cancel(kthread_t *thr, void *retval) void kthread_exit(void *retval) { // NOT_YET_IMPLEMENTED("PROCS: kthread_exit"); - + dbg(DBG_THR, "Exiting thread with proc name=%s, id=%d, status=%d\n", + curthr->kt_proc->p_name, curthr->kt_proc->p_pid, (int) retval); proc_thread_exiting(retval); } |