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