Lines Matching refs:new_thread
570 thread_t new_thread;
577 new_thread = first_thread = current_thread();
579 new_thread = (thread_t)zalloc(thread_zone);
580 if (new_thread == NULL)
583 if (new_thread != first_thread)
584 *new_thread = thread_template;
588 new_thread->uthread = uthread_alloc(parent_task, new_thread);
589 if (new_thread->uthread == NULL) {
590 zfree(thread_zone, new_thread);
596 if (machine_thread_create(new_thread, parent_task) != KERN_SUCCESS) {
599 void *ut = new_thread->uthread;
601 new_thread->uthread = NULL;
608 zfree(thread_zone, new_thread);
612 new_thread->task = parent_task;
614 thread_lock_init(new_thread);
615 wake_lock_init(new_thread);
617 mutex_init(&new_thread->mutex, 0);
619 ipc_thread_init(new_thread);
620 queue_init(&new_thread->held_ulocks);
622 new_thread->continuation = continuation;
635 void *ut = new_thread->uthread;
637 new_thread->uthread = NULL;
644 ipc_thread_disable(new_thread);
645 ipc_thread_terminate(new_thread);
646 machine_thread_destroy(new_thread);
647 zfree(thread_zone, new_thread);
654 new_thread->map = parent_task->map;
657 queue_enter(&parent_task->threads, new_thread, thread_t, task_threads);
663 queue_enter(&threads, new_thread, thread_t, threads);
666 timer_call_setup(&new_thread->wait_timer, thread_timer_expire, new_thread);
667 timer_call_setup(&new_thread->depress_timer, thread_depress_expire, new_thread);
671 new_thread->sched_mode |= TH_MODE_TIMESHARE;
672 new_thread->max_priority = parent_task->max_priority;
673 new_thread->task_priority = parent_task->priority;
674 new_thread->priority = (priority < 0)? parent_task->priority: priority;
675 if (new_thread->priority > new_thread->max_priority)
676 new_thread->priority = new_thread->max_priority;
677 new_thread->importance =
678 new_thread->priority - new_thread->task_priority;
679 new_thread->sched_stamp = sched_tick;
680 new_thread->pri_shift = sched_pri_shift;
681 compute_priority(new_thread, FALSE);
683 new_thread->active = TRUE;
685 *out_thread = new_thread;
694 (vm_address_t)new_thread, dbg_arg2, 0, 0, 0);
712 thread_t *new_thread)
732 *new_thread = thread;
743 thread_t *new_thread)
773 *new_thread = thread;
789 thread_t *new_thread)
813 *new_thread = thread;
823 thread_t *new_thread)
836 *new_thread = thread;
845 thread_t *new_thread)
847 return kernel_thread_start_priority(continuation, parameter, -1, new_thread);