Subversion Repositories HelenOS-historic

Rev

Rev 814 | Rev 842 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 814 Rev 822
Line 224... Line 224...
224
 *
224
 *
225
 */
225
 */
226
thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags)
226
thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags)
227
{
227
{
228
    thread_t *t;
228
    thread_t *t;
-
 
229
    ipl_t ipl;
229
 
230
   
230
    t = (thread_t *) slab_alloc(thread_slab, 0);
231
    t = (thread_t *) slab_alloc(thread_slab, 0);
231
    if (t) {
-
 
232
        ipl_t ipl;
-
 
233
   
232
   
234
        /* Not needed, but good for debugging */
233
    /* Not needed, but good for debugging */
235
        memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0);
234
    memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0);
236
 
235
   
237
        ipl = interrupts_disable();
236
    ipl = interrupts_disable();
Line 284... Line 283...
284
        spinlock_lock(&task->lock);
283
    spinlock_lock(&task->lock);
285
        list_append(&t->th_link, &task->th_head);
284
    list_append(&t->th_link, &task->th_head);
286
        spinlock_unlock(&task->lock);
285
    spinlock_unlock(&task->lock);
287
 
286
   
288
        interrupts_restore(ipl);
287
    interrupts_restore(ipl);
289
    }
-
 
290
 
288
 
291
    return t;
289
    return t;
292
}
290
}
293
 
291
 
294
 
292