Changes in kernel/generic/src/proc/task.c [3ac5086:feeac0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r3ac5086 rfeeac0d 41 41 #include <mm/slab.h> 42 42 #include <atomic.h> 43 #include <synch/futex.h>44 43 #include <synch/spinlock.h> 45 44 #include <synch/waitq.h> … … 126 125 { 127 126 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 } 128 137 129 138 /* Repeat until there are any tasks except TASK */ … … 154 163 155 164 irq_spinlock_initialize(&task->lock, "task_t_lock"); 165 mutex_initialize(&task->futexes_lock, MUTEX_PASSIVE); 156 166 157 167 list_initialize(&task->threads); … … 165 175 spinlock_initialize(&task->active_calls_lock, "active_calls_lock"); 166 176 list_initialize(&task->active_calls); 167 177 168 178 #ifdef CONFIG_UDEBUG 169 179 /* Init kbox stuff */ … … 196 206 task->ucycles = 0; 197 207 task->kcycles = 0; 198 208 199 209 task->ipc_info.call_sent = 0; 200 210 task->ipc_info.call_received = 0; … … 221 231 (void) ipc_phone_connect(&task->phones[0], ipc_phone_0); 222 232 223 futex_task_init(task);233 btree_create(&task->futexes); 224 234 225 235 /* … … 262 272 * Free up dynamically allocated state. 263 273 */ 264 futex_task_deinit(task);274 btree_destroy(&task->futexes); 265 275 266 276 /* … … 442 452 443 453 /* 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) { 447 455 irq_spinlock_lock(&thread->lock, false); 448 456 … … 474 482 */ 475 483 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) { 478 485 bool sleeping = false; 479 486
Note:
See TracChangeset
for help on using the changeset viewer.