Lines Matching defs:t

95  * sublist.  Given a thread t that is the head of a sublist (the first
97 * t->t_priback->t_link points to the head of the next sublist. It's
119 waitq_link(waitq_t *wq, kthread_t *t)
128 tpri = DISP_PRIO(t);
138 *tpp = t;
139 t->t_link = next_tp;
142 t->t_priback = last_tp;
143 t->t_priforw = last_tp->t_priforw;
144 last_tp->t_priforw->t_priback = t;
145 last_tp->t_priforw = t;
147 t->t_priback = t->t_priforw = t;
150 t->t_waitq = wq;
154 waitq_unlink(waitq_t *wq, kthread_t *t)
159 ASSERT(THREAD_LOCK_HELD(t));
161 ASSERT(t->t_waitq == wq);
163 ptl = &t->t_priback->t_link;
168 if (*ptl != t) {
172 ptl = &t->t_waitq->wq_first;
173 while ((nt = *ptl) != t)
179 *ptl = t->t_link;
185 if (t->t_priforw != t) {
186 t->t_priback->t_priforw = t->t_priforw;
187 t->t_priforw->t_priback = t->t_priback;
189 t->t_link = NULL;
192 t->t_waitq = NULL;
193 t->t_priforw = NULL;
194 t->t_priback = NULL;
203 waitq_enqueue(waitq_t *wq, kthread_t *t)
205 ASSERT(THREAD_LOCK_HELD(t));
206 ASSERT(t->t_sleepq == NULL);
207 ASSERT(t->t_waitq == NULL);
208 ASSERT(t->t_link == NULL);
213 * Can't enqueue anything on a blocked wait queue
224 t->t_waitrq = gethrtime_unscaled();
230 t->t_schedflag |= TS_DONT_SWAP;
231 DTRACE_SCHED1(cpucaps__sleep, kthread_t *, t);
232 waitq_link(wq, t);
234 THREAD_WAIT(t, &wq->wq_lock);
243 waitq_change_pri(kthread_t *t, pri_t new_pri)
245 waitq_t *wq = t->t_waitq;
247 ASSERT(THREAD_LOCK_HELD(t));
248 ASSERT(ISWAITING(t));
251 waitq_unlink(wq, t);
252 t->t_pri = new_pri;
253 waitq_link(wq, t);
257 waitq_dequeue(waitq_t *wq, kthread_t *t)
259 ASSERT(THREAD_LOCK_HELD(t));
260 ASSERT(t->t_waitq == wq);
261 ASSERT(ISWAITING(t));
263 waitq_unlink(wq, t);
264 DTRACE_SCHED1(cpucaps__wakeup, kthread_t *, t);
271 THREAD_TRANSITION(t);
289 waitq_setrun(kthread_t *t)
291 waitq_t *wq = t->t_waitq;
293 ASSERT(THREAD_LOCK_HELD(t));
295 ASSERT(ISWAITING(t));
297 panic("waitq_setrun: thread %p is not on waitq", (void *)t);
298 waitq_dequeue(wq, t);
299 CL_SETRUN(t);
308 kthread_t *t;
314 if ((t = wq->wq_first) != NULL)
318 return (t);
328 kthread_t *t;
330 t = waitq_takeone(wq);
331 if (t != NULL) {
333 * t should have transition lock held.
337 ASSERT(THREAD_LOCK_HELD(t));
338 CL_SETRUN(t);
339 thread_unlock(t);
341 return (t);