Subversion Repositories HelenOS

Rev

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

Rev 2041 Rev 2042
Line 218... Line 218...
218
        USTACK_ADDRESS, AS_AREA_ATTR_NONE, &anon_backend, NULL);
218
        USTACK_ADDRESS, AS_AREA_ATTR_NONE, &anon_backend, NULL);
219
 
219
 
220
    /*
220
    /*
221
     * Create the main thread.
221
     * Create the main thread.
222
     */
222
     */
223
    t1 = thread_create(uinit, kernel_uarg, task, THREAD_FLAG_USPACE, "uinit");
223
    t1 = thread_create(uinit, kernel_uarg, task, THREAD_FLAG_USPACE, "uinit", false);
224
    ASSERT(t1);
224
    ASSERT(t1);
225
   
225
   
226
    /*
226
    /*
227
     * Create killer thread for the new task.
227
     * Create killer thread for the new task.
228
     */
228
     */
229
    t2 = thread_create(ktaskgc, t1, task, 0, "ktaskgc");
229
    t2 = thread_create(ktaskgc, t1, task, 0, "ktaskgc", true);
230
    ASSERT(t2);
230
    ASSERT(t2);
231
    thread_ready(t2);
231
    thread_ready(t2);
232
 
232
 
233
    thread_ready(t1);
233
    thread_ready(t1);
234
 
234
 
Line 283... Line 283...
283
    link_t *cur;
283
    link_t *cur;
284
    for (cur = t->th_head.next; cur != &t->th_head; cur = cur->next) {
284
    for (cur = t->th_head.next; cur != &t->th_head; cur = cur->next) {
285
        thread_t *thr = list_get_instance(cur, thread_t, th_link);
285
        thread_t *thr = list_get_instance(cur, thread_t, th_link);
286
       
286
       
287
        spinlock_lock(&thr->lock);
287
        spinlock_lock(&thr->lock);
-
 
288
        /* Process only counted threads */
288
       
289
        if (!thr->uncounted) {
289
        if (thr == THREAD) /* Update accounting of current thread */
290
            if (thr == THREAD) /* Update accounting of current thread */
290
            thread_update_accounting();
291
                thread_update_accounting();
291
        ret += thr->cycles;
292
            ret += thr->cycles;
292
       
293
        }
293
        spinlock_unlock(&thr->lock);
294
        spinlock_unlock(&thr->lock);
294
    }
295
    }
295
   
296
   
296
    return ret;
297
    return ret;
297
}
298
}
Line 326... Line 327...
326
    spinlock_unlock(&ta->lock);
327
    spinlock_unlock(&ta->lock);
327
 
328
 
328
    btree_remove(&tasks_btree, ta->taskid, NULL);
329
    btree_remove(&tasks_btree, ta->taskid, NULL);
329
    spinlock_unlock(&tasks_lock);
330
    spinlock_unlock(&tasks_lock);
330
   
331
   
331
    t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp");
332
    t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp", true);
332
   
333
   
333
    spinlock_lock(&ta->lock);
334
    spinlock_lock(&ta->lock);
334
    ta->accept_new_threads = false;
335
    ta->accept_new_threads = false;
335
    ta->refcount--;
336
    ta->refcount--;
336
 
337