Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2853 → Rev 2854

/branches/tracing/kernel/generic/src/proc/thread.c
422,11 → 422,25
atomic_inc(&task->refcount);
atomic_inc(&task->lifecount);
 
list_append(&t->th_link, &task->th_head);
 
/*
* Copy task debugging state to thread struct.
* The thread needs to know it is being debugged,
* otherwise it would neither stop nor respond to
* debug ops.
*/
if (t->flags & THREAD_FLAG_USPACE) {
if (task->dt_state == UDEBUG_TS_BEGINNING ||
task->dt_state == UDEBUG_TS_ACTIVE) {
t->debug_active = true;
}
}
 
/* FIXME: this must be done very carefully.. an unstoppable
thread cannot appear just-so, it must be possible to catch it. */
if (t->flags & THREAD_FLAG_USPACE)
++task->not_stoppable_count;
list_append(&t->th_link, &task->th_head);
}
 
/** Add thread to the threads tree.