Subversion Repositories HelenOS

Rev

Rev 2848 | Rev 2865 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2848 Rev 2854
Line 420... Line 420...
420
static void _thread_attach_task(thread_t *t, task_t *task)
420
static void _thread_attach_task(thread_t *t, task_t *task)
421
{
421
{
422
    atomic_inc(&task->refcount);
422
    atomic_inc(&task->refcount);
423
    atomic_inc(&task->lifecount);
423
    atomic_inc(&task->lifecount);
424
 
424
 
-
 
425
    list_append(&t->th_link, &task->th_head);
-
 
426
 
-
 
427
    /*
-
 
428
     * Copy task debugging state to thread struct.
-
 
429
     * The thread needs to know it is being debugged,
-
 
430
     * otherwise it would neither stop nor respond to
-
 
431
     * debug ops.
-
 
432
     */
-
 
433
    if (t->flags & THREAD_FLAG_USPACE) {
-
 
434
        if (task->dt_state == UDEBUG_TS_BEGINNING ||
-
 
435
            task->dt_state == UDEBUG_TS_ACTIVE) {
-
 
436
            t->debug_active = true;
-
 
437
        }
-
 
438
    }
-
 
439
 
425
    /* FIXME: this must be done very carefully.. an unstoppable
440
    /* FIXME: this must be done very carefully.. an unstoppable
426
       thread cannot appear just-so, it must be possible to catch it. */
441
       thread cannot appear just-so, it must be possible to catch it. */
427
    if (t->flags & THREAD_FLAG_USPACE)
442
    if (t->flags & THREAD_FLAG_USPACE)
428
        ++task->not_stoppable_count;
443
        ++task->not_stoppable_count;
429
    list_append(&t->th_link, &task->th_head);
-
 
430
}
444
}
431
 
445
 
432
/** Add thread to the threads tree.
446
/** Add thread to the threads tree.
433
 *
447
 *
434
 * Interrupts must be already disabled.
448
 * Interrupts must be already disabled.