Lines Matching refs:thread

35 #include <kern/thread.h>
112 * retrieving the first thread for extra safety.
116 thread_t thread = (thread_t)(void *)queue_first(&task->threads);
118 if (queue_end(&task->threads, (queue_entry_t)thread))
119 thread = THREAD_NULL;
124 return (thread);
134 thread_t inc, thread = THREAD_NULL;
149 thread = inc;
158 *result_out = thread;
160 if (thread) {
162 act_set_astbsd(thread);
164 thread_mtx_unlock(thread);
178 thread_t thread,
194 if (inc == thread) {
212 act_set_astbsd(thread);
214 thread_mtx_unlock(thread);
228 * This is only safe to call from a thread executing in
296 * Swap in a new map for the task/thread pair; the old map reference is
300 swap_task_map(task_t task, thread_t thread, vm_map_t map, boolean_t doswitch)
304 if (task != thread->task)
310 thread->map = task->map = map;
318 inval_copy_windows(thread);
573 * see if the current thread is aborted. But unlike above, it also
574 * checks to see if thread is safely aborted. If so, it returns
641 thread_t thread;
662 queue_iterate(&task->threads, thread, thread_t, task_threads) {
666 if (thread->options & TH_OPT_IDLE_THREAD)
670 thread_lock(thread);
672 if ((thread->state & TH_RUN) == TH_RUN)
674 cswitch += thread->c_switch;
675 tval = timer_grab(&thread->user_timer);
679 tval = timer_grab(&thread->system_timer);
681 if (thread->precise_user_kernel_time) {
690 syscalls_unix += thread->syscalls_unix;
691 syscalls_mach += thread->syscalls_mach;
693 thread_unlock(thread);
865 thread_t thread;
871 queue_iterate(&task->threads, thread, thread_t, task_threads) {
872 if (thread->options & TH_OPT_IDLE_THREAD)
875 thread_mtx_lock(thread);
876 thread_update_qos_cpu_time(thread, TRUE);
877 thread_mtx_unlock(thread);