Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/task.c

    r3ac5086 rfeeac0d  
    4141#include <mm/slab.h>
    4242#include <atomic.h>
    43 #include <synch/futex.h>
    4443#include <synch/spinlock.h>
    4544#include <synch/waitq.h>
     
    126125{
    127126        size_t tasks_left;
     127
     128        if (ipc_phone_0) {
     129                task_t *task_0 = ipc_phone_0->task;
     130                ipc_phone_0 = NULL;
     131                /*
     132                 * The first task is held by kinit(), we need to release it or
     133                 * it will never finish cleanup.
     134                 */
     135                task_release(task_0);
     136        }
    128137       
    129138        /* Repeat until there are any tasks except TASK */
     
    154163       
    155164        irq_spinlock_initialize(&task->lock, "task_t_lock");
     165        mutex_initialize(&task->futexes_lock, MUTEX_PASSIVE);
    156166       
    157167        list_initialize(&task->threads);
     
    165175        spinlock_initialize(&task->active_calls_lock, "active_calls_lock");
    166176        list_initialize(&task->active_calls);
    167                
     177       
    168178#ifdef CONFIG_UDEBUG
    169179        /* Init kbox stuff */
     
    196206        task->ucycles = 0;
    197207        task->kcycles = 0;
    198        
     208
    199209        task->ipc_info.call_sent = 0;
    200210        task->ipc_info.call_received = 0;
     
    221231                (void) ipc_phone_connect(&task->phones[0], ipc_phone_0);
    222232       
    223         futex_task_init(task);
     233        btree_create(&task->futexes);
    224234       
    225235        /*
     
    262272         * Free up dynamically allocated state.
    263273         */
    264         futex_task_deinit(task);
     274        btree_destroy(&task->futexes);
    265275       
    266276        /*
     
    442452       
    443453        /* Current values of threads */
    444         list_foreach(task->threads, cur) {
    445                 thread_t *thread = list_get_instance(cur, thread_t, th_link);
    446                
     454        list_foreach(task->threads, th_link, thread_t, thread) {
    447455                irq_spinlock_lock(&thread->lock, false);
    448456               
     
    474482         */
    475483       
    476         list_foreach(task->threads, cur) {
    477                 thread_t *thread = list_get_instance(cur, thread_t, th_link);
     484        list_foreach(task->threads, th_link, thread_t, thread) {
    478485                bool sleeping = false;
    479486               
Note: See TracChangeset for help on using the changeset viewer.