Lines Matching refs:new_thread

650 	thread_t				new_thread;
657 new_thread = first_thread = current_thread();
658 new_thread = (thread_t)zalloc(thread_zone);
659 if (new_thread == THREAD_NULL)
662 if (new_thread != first_thread)
663 *new_thread = thread_template;
666 new_thread->uthread = uthread_alloc(parent_task, new_thread, (options & TH_OPTION_NOCRED) != 0);
667 if (new_thread->uthread == NULL) {
668 zfree(thread_zone, new_thread);
673 if (machine_thread_create(new_thread, parent_task) != KERN_SUCCESS) {
675 void *ut = new_thread->uthread;
677 new_thread->uthread = NULL;
684 zfree(thread_zone, new_thread);
688 new_thread->task = parent_task;
690 thread_lock_init(new_thread);
691 wake_lock_init(new_thread);
693 lck_mtx_init(&new_thread->mutex, &thread_lck_grp, &thread_lck_attr);
695 ipc_thread_init(new_thread);
696 queue_init(&new_thread->held_ulocks);
698 new_thread->continuation = continuation;
713 void *ut = new_thread->uthread;
715 new_thread->uthread = NULL;
722 ipc_thread_disable(new_thread);
723 ipc_thread_terminate(new_thread);
724 lck_mtx_destroy(&new_thread->mutex, &thread_lck_grp);
725 machine_thread_destroy(new_thread);
726 zfree(thread_zone, new_thread);
731 machine_thread_inherit_taskwide(new_thread, parent_task);
735 if (new_thread->task->rusage_cpu_flags & TASK_RUSECPU_FLAGS_PERTHR_LIMIT) {
740 set_astledger(new_thread);
742 new_thread->t_threadledger = LEDGER_NULL; /* per thread ledger is not inherited */
743 new_thread->t_ledger = new_thread->task->ledger;
744 if (new_thread->t_ledger)
745 ledger_reference(new_thread->t_ledger);
748 new_thread->map = parent_task->map;
751 queue_enter(&parent_task->threads, new_thread, thread_t, task_threads);
758 new_thread->thread_id = ++thread_unique_id;
760 queue_enter(&threads, new_thread, thread_t, threads);
763 timer_call_setup(&new_thread->wait_timer, thread_timer_expire, new_thread);
764 timer_call_setup(&new_thread->depress_timer, thread_depress_expire, new_thread);
771 new_thread->t_chud = (TASK_PMC_FLAG == (parent_task->t_chud & TASK_PMC_FLAG)) ?
776 new_thread->sched_mode = SCHED(initial_thread_sched_mode)(parent_task);
777 new_thread->sched_flags = 0;
778 new_thread->max_priority = parent_task->max_priority;
779 new_thread->task_priority = parent_task->priority;
780 new_thread->priority = (priority < 0)? parent_task->priority: priority;
781 if (new_thread->priority > new_thread->max_priority)
782 new_thread->priority = new_thread->max_priority;
784 if (new_thread->priority < MAXPRI_THROTTLE) {
785 new_thread->priority = MAXPRI_THROTTLE;
788 new_thread->importance =
789 new_thread->priority - new_thread->task_priority;
791 new_thread->saved_importance = new_thread->importance;
795 new_thread->policystate.hw_bg = TASK_POLICY_BACKGROUND_ATTRIBUTE_ALL;
797 new_thread->appliedstate.hw_bg = new_thread->policystate.hw_bg;
799 new_thread->importance = INT_MIN;
801 new_thread->priority = MAXPRI_THROTTLE;
806 new_thread->sched_stamp = sched_tick;
807 new_thread->pri_shift = sched_pri_shift;
809 SCHED(compute_priority)(new_thread, FALSE);
811 new_thread->active = TRUE;
813 *out_thread = new_thread;
822 (vm_address_t)(uintptr_t)thread_tid(new_thread), dbg_arg2, 0, 0, 0);
840 thread_t *new_thread,
864 *new_thread = thread;
873 thread_t *new_thread);
878 thread_t *new_thread)
880 return thread_create_internal2(task, new_thread, FALSE);
886 thread_t *new_thread)
888 return thread_create_internal2(task, new_thread, TRUE);
897 thread_t *new_thread,
931 *new_thread = thread;
943 thread_t *new_thread);
951 thread_t *new_thread)
955 new_thread, FALSE);
964 thread_t *new_thread)
968 new_thread, TRUE);
975 thread_t *new_thread)
995 *new_thread = thread;
1011 thread_t *new_thread)
1035 *new_thread = thread;
1045 thread_t *new_thread)
1054 *new_thread = thread;
1067 thread_t *new_thread)
1069 return kernel_thread_start_priority(continuation, parameter, -1, new_thread);