180,7 → 180,9 |
return -1; |
} |
|
#ifdef CONFIG_UDEBUG |
mutex_initialize(&t->udebug.lock, MUTEX_PASSIVE); |
#endif |
|
return 0; |
} |
348,9 → 350,11 |
|
avltree_node_initialize(&t->threads_tree_node); |
t->threads_tree_node.key = (uintptr_t) t; |
|
|
#ifdef CONFIG_UDEBUG |
/* Init debugging stuff */ |
udebug_thread_initialize(&t->udebug); |
#endif |
|
/* might depend on previous initialization */ |
thread_create_arch(t); |
418,10 → 422,13 |
*/ |
ipl = interrupts_disable(); |
spinlock_lock(&task->lock); |
|
atomic_inc(&task->refcount); |
|
/* Must not count kbox thread into lifecount */ |
if (t->flags & THREAD_FLAG_USPACE) |
atomic_inc(&task->lifecount); |
|
list_append(&t->th_link, &task->th_head); |
spinlock_unlock(&task->lock); |
|
445,9 → 452,10 |
ipl_t ipl; |
|
if (THREAD->flags & THREAD_FLAG_USPACE) { |
#ifdef CONFIG_UDEBUG |
/* Generate udebug THREAD_E event */ |
udebug_thread_e_event(); |
|
#endif |
if (atomic_predec(&TASK->lifecount) == 0) { |
/* |
* We are the last userspace thread in the task that |
752,8 → 760,10 |
thread_attach(t, TASK); |
thread_ready(t); |
|
#ifdef CONFIG_UDEBUG |
/* Generate udebug THREAD_B event */ |
udebug_thread_b_event(t); |
#endif |
|
return 0; |
} else |