Lines Matching defs:newthread

264         thread_t* newthread = list_remove_head_type(&c->run_queue[highest_queue], thread_t, queue_node);
266 DEBUG_ASSERT(newthread);
267 DEBUG_ASSERT_MSG(newthread->cpu_affinity & cpu_num_to_mask(cpu),
268 "thread %p name %s, aff %#x cpu %u\n", newthread, newthread->name,
269 newthread->cpu_affinity, cpu);
270 DEBUG_ASSERT(newthread->curr_cpu == cpu);
276 LOCAL_KTRACE2("sched_get_top", newthread->priority_boost, newthread->base_priority);
278 return newthread;
767 // after set_current_thread (we'd now see newthread's unsafe-sp instead!).
771 thread_t* newthread) {
772 set_current_thread(newthread);
773 arch_context_switch(oldthread, newthread);
791 thread_t* newthread = sched_get_top_thread(cpu);
793 DEBUG_ASSERT(newthread);
795 newthread->state = THREAD_RUNNING;
801 LOCAL_KTRACE2("resched new pri", (uint32_t)newthread->user_tid, effec_priority(newthread));
805 mp_prepare_current_cpu_idle_state(thread_is_idle(newthread));
808 if (newthread == oldthread) {
822 if (newthread->remaining_time_slice == 0) {
823 newthread->remaining_time_slice = THREAD_INITIAL_TIME_SLICE;
826 newthread->last_started_running = now;
832 newthread->last_cpu = cpu;
833 newthread->curr_cpu = cpu;
837 if (thread_is_idle(newthread)) {
841 if (thread_is_realtime(newthread)) {
855 LOCAL_KTRACE2("CS timeslice new", (uint32_t)newthread->user_tid, newthread->remaining_time_slice);
857 ktrace(TAG_CONTEXT_SWITCH, (uint32_t)newthread->user_tid,
859 (oldthread->effec_priority << 16) | (newthread->effec_priority << 24)),
860 (uint32_t)(uintptr_t)oldthread, (uint32_t)(uintptr_t)newthread);
862 if (thread_is_real_time_or_idle(newthread)) {
867 cpu, oldthread, oldthread->name, newthread, newthread->name);
873 cpu, oldthread, oldthread->name, newthread, newthread->name);
876 DEBUG_ASSERT(newthread->remaining_time_slice > 0 && newthread->remaining_time_slice < ZX_SEC(1));
878 timer_preempt_reset(zx_time_add_duration(now, newthread->remaining_time_slice));
882 target_set_debug_led(0, !thread_is_idle(newthread));
888 oldthread->flags, newthread, newthread->name,
889 newthread->effec_priority, newthread->base_priority,
890 newthread->priority_boost, newthread->flags);
893 if (newthread->aspace != oldthread->aspace) {
894 vmm_context_switch(oldthread->aspace, newthread->aspace);
898 final_context_switch(oldthread, newthread);