Lines Matching refs:th
699 thread_t th = get_machthread(uth); in workq_thread_reset_pri() local
724 thread_set_workq_pri(th, THREAD_QOS_UNSPECIFIED, mgr_pri, in workq_thread_reset_pri()
789 thread_set_preadopt_thread_group(th, KQWL_GET_PREADOPTED_TG(old_tg)); in workq_thread_reset_pri()
810 thread_set_preadopt_thread_group(th, KQWL_GET_PREADOPTED_TG(old_tg)); in workq_thread_reset_pri()
813 thread_set_preadopt_thread_group(th, NULL); in workq_thread_reset_pri()
818 thread_set_preadopt_thread_group(th, NULL); in workq_thread_reset_pri()
821 thread_set_workq_pri(th, qos, priority, policy); in workq_thread_reset_pri()
1041 workq_thread_init_and_wq_lock(task_t task, thread_t th) in workq_thread_init_and_wq_lock() argument
1043 struct uthread *uth = get_bsdthread_info(th); in workq_thread_init_and_wq_lock()
1051 thread_set_tag(th, THREAD_TAG_PTHREAD | THREAD_TAG_WORKQUEUE); in workq_thread_init_and_wq_lock()
1052 thread_reset_workq_qos(th, THREAD_QOS_LEGACY); in workq_thread_init_and_wq_lock()
1075 thread_t th; in workq_add_new_idle_thread() local
1092 &th, in workq_add_new_idle_thread()
1104 struct uthread *uth = get_bsdthread_info(th); in workq_add_new_idle_thread()
1114 *new_thread = th; in workq_add_new_idle_thread()
1200 thread_t th = get_machthread(uth); in workq_unpark_for_death_and_unlock() local
1207 pthread_functions->workq_setup_thread(p, th, vmap, uth->uu_workq_stackaddr, in workq_unpark_for_death_and_unlock()
2269 thread_t th = current_thread(); in workq_exit() local
2273 if (thread_get_tag(th) & THREAD_TAG_WORKQUEUE) { in workq_exit()
2279 thread_sched_call(th, NULL); in workq_exit()
2345 bsdthread_set_self(proc_t p, thread_t th, pthread_priority_t priority, in bsdthread_set_self() argument
2348 struct uthread *uth = get_bsdthread_info(th); in bsdthread_set_self()
2353 bool is_wq_thread = (thread_get_tag(th) & THREAD_TAG_WORKQUEUE); in bsdthread_set_self()
2355 assert(th == current_thread()); in bsdthread_set_self()
2420 if (!thread_has_qos_policy(th)) { in bsdthread_set_self()
2468 thread_mtx_lock(th); in bsdthread_set_self()
2522 thread_mtx_unlock(th); in bsdthread_set_self()
2526 thread_disarm_workqueue_quantum(th); in bsdthread_set_self()
2530 thread_arm_workqueue_quantum(th); in bsdthread_set_self()
2534 kr = thread_policy_set_internal(th, THREAD_QOS_POLICY, in bsdthread_set_self()
2563 kr = thread_policy_set_internal(th, THREAD_EXTENDED_POLICY, in bsdthread_set_self()
2578 kr = thread_policy_set_internal(th, THREAD_EXTENDED_POLICY, in bsdthread_set_self()
2621 thread_t th = port_name_to_thread(kport, in bsdthread_add_explicit_override() local
2623 if (th == THREAD_NULL) { in bsdthread_add_explicit_override()
2627 int rv = proc_thread_qos_add_override(proc_task(p), th, 0, qos, TRUE, in bsdthread_add_explicit_override()
2630 thread_deallocate(th); in bsdthread_add_explicit_override()
2638 thread_t th = port_name_to_thread(kport, in bsdthread_remove_explicit_override() local
2640 if (th == THREAD_NULL) { in bsdthread_remove_explicit_override()
2644 int rv = proc_thread_qos_remove_override(proc_task(p), th, 0, resource, in bsdthread_remove_explicit_override()
2647 thread_deallocate(th); in bsdthread_remove_explicit_override()
3502 thread_t th = get_machthread(uth); in workq_kern_bound_thread_terminate() local
3509 pthread_functions->workq_setup_thread(p, th, vmap, uth->uu_workq_stackaddr, in workq_kern_bound_thread_terminate()
3606 thread_t th = current_thread(); in workq_thread_return() local
3607 struct uthread *uth = get_bsdthread_info(th); in workq_thread_return()
3613 if (((thread_get_tag(th) & THREAD_TAG_WORKQUEUE) == 0) || in workq_thread_return()
3652 thread_freeze_base_pri(th); in workq_thread_return()
3676 error = pthread_functions->workq_handle_stack_events(p, th, in workq_thread_return()
3694 thread_sched_call(th, NULL); in workq_thread_return()
3695 thread_will_park_or_terminate(th); in workq_thread_return()
3810 thread_t th = current_thread(); in workq_kernreturn() local
3811 struct uthread *uth = get_bsdthread_info(th); in workq_kernreturn()
3812 if (((thread_get_tag(th) & THREAD_TAG_WORKQUEUE) == 0) || in workq_kernreturn()
4852 thread_t th = current_thread(); in workq_unpark_continue() local
4853 struct uthread *uth = get_bsdthread_info(th); in workq_unpark_continue()
4905 thread_t th = get_machthread(uth); in workq_setup_and_run() local
4951 thread_reference(th); in workq_setup_and_run()
4953 ipc_port_t port = convert_thread_to_port_pinned(th); in workq_setup_and_run()
4960 if (thread_supports_cooperative_workqueue(th)) { in workq_setup_and_run()
4961 thread_arm_workqueue_quantum(th); in workq_setup_and_run()
4963 thread_disarm_workqueue_quantum(th); in workq_setup_and_run()
4974 thread_sched_call(th, NULL); in workq_setup_and_run()
4976 thread_sched_call(th, workq_sched_callback); in workq_setup_and_run()
4979 pthread_functions->workq_setup_thread(p, th, vmap, uth->uu_workq_stackaddr, in workq_setup_and_run()