Lines Matching refs:thr
60 Thread *thr = curProc[CPU()];
61 Thread_Retain(thr);
65 return thr;
74 * @param [in] thr Thread to be set as runnable.
77 Sched_SetRunnable(Thread *thr)
81 if (thr->proc->procState == PROC_STATE_NULL)
82 thr->proc->procState = PROC_STATE_READY;
84 if (thr->schedState == SCHED_STATE_WAITING) {
85 thr->waitTime += KTime_GetEpochNS() - thr->waitStart;
86 thr->waitStart = 0;
87 TAILQ_REMOVE(&waitQueue, thr, schedQueue);
89 thr->schedState = SCHED_STATE_RUNNABLE;
90 TAILQ_INSERT_TAIL(&runnableQueue, thr, schedQueue);
101 * @param [in] thr Thread to be set as waiting.
104 Sched_SetWaiting(Thread *thr)
108 ASSERT(thr->schedState == SCHED_STATE_RUNNING);
110 thr->schedState = SCHED_STATE_WAITING;
111 TAILQ_INSERT_TAIL(&waitQueue, thr, schedQueue);
112 thr->waitStart = KTime_GetEpochNS();
123 * @param [in] thr Thread to be set as zombie.
126 Sched_SetZombie(Thread *thr)
128 Process *proc = thr->proc;
153 thr->schedState = SCHED_STATE_ZOMBIE;
157 TAILQ_INSERT_TAIL(&proc->zombieQueue, thr, schedQueue);