Ignore:
File:
1 edited

Legend:

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

    rfeeac0d r3ac5086  
    4141#include <mm/slab.h>
    4242#include <atomic.h>
     43#include <synch/futex.h>
    4344#include <synch/spinlock.h>
    4445#include <synch/waitq.h>
     
    125126{
    126127        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         }
    137128       
    138129        /* Repeat until there are any tasks except TASK */
     
    163154       
    164155        irq_spinlock_initialize(&task->lock, "task_t_lock");
    165         mutex_initialize(&task->futexes_lock, MUTEX_PASSIVE);
    166156       
    167157        list_initialize(&task->threads);
     
    175165        spinlock_initialize(&task->active_calls_lock, "active_calls_lock");
    176166        list_initialize(&task->active_calls);
    177        
     167               
    178168#ifdef CONFIG_UDEBUG
    179169        /* Init kbox stuff */
     
    206196        task->ucycles = 0;
    207197        task->kcycles = 0;
    208 
     198       
    209199        task->ipc_info.call_sent = 0;
    210200        task->ipc_info.call_received = 0;
     
    231221                (void) ipc_phone_connect(&task->phones[0], ipc_phone_0);
    232222       
    233         btree_create(&task->futexes);
     223        futex_task_init(task);
    234224       
    235225        /*
     
    272262         * Free up dynamically allocated state.
    273263         */
    274         btree_destroy(&task->futexes);
     264        futex_task_deinit(task);
    275265       
    276266        /*
     
    452442       
    453443        /* Current values of threads */
    454         list_foreach(task->threads, th_link, thread_t, thread) {
     444        list_foreach(task->threads, cur) {
     445                thread_t *thread = list_get_instance(cur, thread_t, th_link);
     446               
    455447                irq_spinlock_lock(&thread->lock, false);
    456448               
     
    482474         */
    483475       
    484         list_foreach(task->threads, th_link, thread_t, thread) {
     476        list_foreach(task->threads, cur) {
     477                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    485478                bool sleeping = false;
    486479               
Note: See TracChangeset for help on using the changeset viewer.