Lines Matching defs:task
113 #include <kern/task.h>
320 task_t task;
369 task = thread->task;
370 uthread_cleanup(task, thread->uthread, task->bsd_info);
371 threadcnt = hw_atomic_sub(&task->active_thread_count, 1);
374 * If we are the last thread to terminate and the task is
377 if (threadcnt == 0 && task->bsd_info != NULL)
378 proc_exit(task->bsd_info);
430 task_t task;
441 task = thread->task;
463 task_deallocate(task);
477 task_t task;
489 task = thread->task;
491 task_lock(task);
492 task->total_user_time += timer_grab(&thread->user_timer);
494 task->total_system_time += timer_grab(&thread->system_timer);
496 task->total_user_time += timer_grab(&thread->system_timer);
499 task->c_switch += thread->c_switch;
500 task->p_switch += thread->p_switch;
501 task->ps_switch += thread->ps_switch;
503 task->syscalls_unix += thread->syscalls_unix;
504 task->syscalls_mach += thread->syscalls_mach;
506 task->task_timer_wakeups_bin_1 += thread->thread_timer_wakeups_bin_1;
507 task->task_timer_wakeups_bin_2 += thread->thread_timer_wakeups_bin_2;
508 queue_remove(&task->threads, thread, thread_t, task_threads);
509 task->thread_count--;
512 * If the task is being halted, and there is only one thread
513 * left in the task after this one, then wakeup that thread.
515 if (task->thread_count == 1 && task->halting)
516 thread_wakeup((event_t)&task->halting);
518 task_unlock(task);
688 new_thread->task = parent_task;
730 /* New threads inherit any default state on the task */
735 if (new_thread->task->rusage_cpu_flags & TASK_RUSECPU_FLAGS_PERTHR_LIMIT) {
737 * This task has a per-thread CPU limit; make sure this new thread
743 new_thread->t_ledger = new_thread->task->ledger;
747 /* Cache the task's map */
750 /* Chain the thread onto the task's list */
754 /* So terminating threads don't need to take the task lock to decrement */
768 * If parent task has any reservations, they need to be propagated to this
839 task_t task,
846 if (task == TASK_NULL || task == kernel_task)
849 result = thread_create_internal(task, -1, (thread_continue_t)thread_bootstrap_return, TH_OPTION_NONE, &thread);
855 if (task->suspend_count > 0)
859 extmod_statistics_incr_thread_create(task);
861 task_unlock(task);
872 task_t task,
877 task_t task,
880 return thread_create_internal2(task, new_thread, FALSE);
885 task_t task,
888 return thread_create_internal2(task, new_thread, TRUE);
893 register task_t task,
903 if (task == TASK_NULL || task == kernel_task)
906 result = thread_create_internal(task, -1, (thread_continue_t)thread_bootstrap_return, TH_OPTION_NONE, &thread);
913 task_unlock(task);
926 extmod_statistics_incr_thread_create(task);
928 task_unlock(task);
939 register task_t task,
947 register task_t task,
954 task, flavor, new_state, new_state_count,
960 register task_t task,
967 task, flavor, new_state, new_state_count,
973 task_t task,
980 if (task == TASK_NULL || task == kernel_task)
983 result = thread_create_internal(task, -1, thread_return, TH_OPTION_NOCRED | TH_OPTION_NOSUSP, &thread);
989 if (task->suspend_count > 0)
992 task_unlock(task);
1003 * Create a thread in the kernel task
1015 task_t task = kernel_task;
1017 result = thread_create_internal(task, priority, continuation, TH_OPTION_NONE, &thread);
1021 task_unlock(task);
1076 task_t task,
1082 if (task != kernel_task)
1202 if(thread->task->bsd_info) {
1203 identifier_info->dispatch_qaddr = identifier_info->thread_handle + get_dispatchqueue_offset_from_proc(thread->task->bsd_info);
1721 if (thread->task->bsd_info)
1722 dispatchqueue_addr = thread_handle + get_dispatchqueue_offset_from_proc(thread->task->bsd_info);
1849 task_t task = current_task();
1850 if(task->thread_count == 1) {