Lines Matching defs:task
34 #include <kern/task.h>
76 return(th->task != TASK_NULL ? th->task->bsd_info : NULL);
106 * Until then, we cannot block here. We know the task
110 thread_t get_firstthread(task_t task)
112 thread_t thread = (thread_t)queue_first(&task->threads);
114 if (queue_end(&task->threads, (queue_entry_t)thread))
117 if (!task->active)
125 task_t task,
132 task_lock(task);
134 if (!task->active) {
135 task_unlock(task);
140 for (inc = (thread_t)queue_first(&task->threads);
141 !queue_end(&task->threads, (queue_entry_t)inc); ) {
165 task_unlock(task);
173 task_t task,
180 task_lock(task);
182 if (!task->active) {
183 task_unlock(task);
188 for (inc = (thread_t)queue_first(&task->threads);
189 !queue_end(&task->threads, (queue_entry_t)inc); ) {
213 task_unlock(task);
225 * in the task's context or if the task is locked Otherwise,
226 * the map could be switched for the task (and freed) before
260 int get_task_numactivethreads(task_t task)
264 task_lock(task);
266 for (inc = (thread_t)queue_first(&task->threads);
267 !queue_end(&task->threads, (queue_entry_t)inc); inc = (thread_t)queue_next(&inc->task_threads))
272 task_unlock(task);
292 * Swap in a new map for the task/thread pair; the old map reference is
296 swap_task_map(task_t task, thread_t thread, vm_map_t map, boolean_t doswitch)
300 if (task != thread->task)
303 task_lock(task);
305 old_map = task->map;
306 thread->map = task->map = map;
311 task_unlock(task);
331 uint64_t get_task_resident_size(task_t task)
335 map = (task == kernel_task) ? kernel_map: task->map;
351 return(th->task);
449 task_t task)
451 return(task->user_stop_count);
469 task_t task)
471 return (task->pidsuspended);
479 task_t task)
481 return (task->frozen);
528 task_t task,
534 task_lock(task);
536 for (inc = (thread_t)queue_first(&task->threads);
537 !queue_end(&task->threads, (queue_entry_t)inc); ) {
542 task_unlock(task);
560 fill_taskprocinfo(task_t task, struct proc_taskinfo_internal * ptinfo)
569 map = (task == kernel_task)? kernel_map: task->map;
576 task_lock(task);
578 ptinfo->pti_policy = ((task != kernel_task)?
582 tinfo.total_user = task->total_user_time;
583 tinfo.total_system = task->total_system_time;
585 queue_iterate(&task->threads, thread, thread_t, task_threads) {
622 ptinfo->pti_faults = task->faults;
623 ptinfo->pti_pageins = task->pageins;
624 ptinfo->pti_cow_faults = task->cow_faults;
625 ptinfo->pti_messages_sent = task->messages_sent;
626 ptinfo->pti_messages_received = task->messages_received;
627 ptinfo->pti_syscalls_mach = task->syscalls_mach + syscalls_mach;
628 ptinfo->pti_syscalls_unix = task->syscalls_unix + syscalls_unix;
629 ptinfo->pti_csw = task->c_switch + cswitch;
630 ptinfo->pti_threadnum = task->thread_count;
632 ptinfo->pti_priority = task->priority;
634 task_unlock(task);
638 fill_taskthreadinfo(task_t task, uint64_t thaddr, int thuniqueid, struct proc_threadinfo_internal * ptinfo, void * vpp, int *vidp)
647 task_lock(task);
649 for (thact = (thread_t)queue_first(&task->threads);
650 !queue_end(&task->threads, (queue_entry_t)thact); ) {
683 task_unlock(task);
688 fill_taskthreadlist(task_t task, void * buffer, int thcount)
697 task_lock(task);
699 for (thact = (thread_t)queue_first(&task->threads);
700 !queue_end(&task->threads, (queue_entry_t)thact); ) {
710 task_unlock(task);
716 get_numthreads(task_t task)
718 return(task->thread_count);