Lines Matching refs:t
68 cv_unsleep(kthread_t *t) in cv_unsleep() argument
70 condvar_impl_t *cvp = (condvar_impl_t *)t->t_wchan; in cv_unsleep()
73 ASSERT(THREAD_LOCK_HELD(t)); in cv_unsleep()
77 (void *)t, (void *)sqh); in cv_unsleep()
78 DTRACE_SCHED1(wakeup, kthread_t *, t); in cv_unsleep()
79 sleepq_unsleep(t); in cv_unsleep()
83 CL_SETRUN(t); in cv_unsleep()
90 cv_change_pri(kthread_t *t, pri_t pri, pri_t *t_prip) in cv_change_pri() argument
92 condvar_impl_t *cvp = (condvar_impl_t *)t->t_wchan; in cv_change_pri()
93 sleepq_t *sqp = t->t_sleepq; in cv_change_pri()
95 ASSERT(THREAD_LOCK_HELD(t)); in cv_change_pri()
99 panic("cv_change_pri: %p not on sleep queue", (void *)t); in cv_change_pri()
100 sleepq_dequeue(t); in cv_change_pri()
102 sleepq_insert(sqp, t); in cv_change_pri()
142 kthread_t *t = curthread; in cv_block() local
143 klwp_t *lwp = ttolwp(t); in cv_block()
146 ASSERT(THREAD_LOCK_HELD(t)); in cv_block()
147 ASSERT(t != CPU->cpu_idle_thread); in cv_block()
149 ASSERT(t->t_wchan0 == NULL && t->t_wchan == NULL); in cv_block()
150 ASSERT(t->t_state == TS_ONPROC); in cv_block()
152 t->t_schedflag &= ~TS_SIGNALLED; in cv_block()
153 CL_SLEEP(t); /* assign kernel priority */ in cv_block()
154 t->t_wchan = (caddr_t)cvp; in cv_block()
155 t->t_sobj_ops = &cv_sobj_ops; in cv_block()
163 if (lwp != NULL && t->t_intr == NULL) { in cv_block()
165 (void) new_mstate(t, LMS_SLEEP); in cv_block()
173 THREAD_SLEEP(t, &sqh->sq_lock); in cv_block()
174 sleepq_insert(&sqh->sq_queue, t); in cv_block()
182 #define cv_block_sig(t, cvp) \ argument
183 { (t)->t_flag |= T_WAKEABLE; cv_block(cvp); }
208 kthread_t *t = arg; in cv_wakeup() local
214 mutex_enter(&t->t_wait_mutex); in cv_wakeup()
215 mutex_exit(&t->t_wait_mutex); in cv_wakeup()
216 setrun(t); in cv_wakeup()
264 kthread_t *t = curthread; in cv_timedwait_hires() local
277 mutex_enter(&t->t_wait_mutex); in cv_timedwait_hires()
278 id = timeout_generic(CALLOUT_REALTIME, (void (*)(void *))cv_wakeup, t, in cv_timedwait_hires()
280 thread_lock(t); /* lock the thread */ in cv_timedwait_hires()
282 thread_unlock_nopreempt(t); in cv_timedwait_hires()
283 mutex_exit(&t->t_wait_mutex); in cv_timedwait_hires()
286 signalled = (t->t_schedflag & TS_SIGNALLED); in cv_timedwait_hires()
307 kthread_t *t = curthread; in cv_wait_sig() local
308 proc_t *p = ttoproc(t); in cv_wait_sig()
309 klwp_t *lwp = ttolwp(t); in cv_wait_sig()
327 ASSERT(t->t_intr == NULL); in cv_wait_sig()
333 thread_lock(t); in cv_wait_sig()
334 cv_block_sig(t, (condvar_impl_t *)cvp); in cv_wait_sig()
335 thread_unlock_nopreempt(t); in cv_wait_sig()
337 if (ISSIG(t, JUSTLOOKING) || MUSTRETURN(p, t) || cancel_pending) in cv_wait_sig()
338 setrun(t); in cv_wait_sig()
341 signalled = (t->t_schedflag & TS_SIGNALLED); in cv_wait_sig()
342 t->t_flag &= ~T_WAKEABLE; in cv_wait_sig()
344 if (ISSIG_PENDING(t, lwp, p)) { in cv_wait_sig()
350 if (lwp->lwp_sysabort || MUSTRETURN(p, t)) in cv_wait_sig()
367 kthread_t *t = curthread; in cv_timedwait_sig_hires() local
368 proc_t *p = ttoproc(t); in cv_timedwait_sig_hires()
369 klwp_t *lwp = ttolwp(t); in cv_timedwait_sig_hires()
387 ASSERT(t->t_intr == NULL); in cv_timedwait_sig_hires()
408 mutex_enter(&t->t_wait_mutex); in cv_timedwait_sig_hires()
409 id = timeout_generic(CALLOUT_REALTIME, (void (*)(void *))cv_wakeup, t, in cv_timedwait_sig_hires()
413 thread_lock(t); in cv_timedwait_sig_hires()
414 cv_block_sig(t, (condvar_impl_t *)cvp); in cv_timedwait_sig_hires()
415 thread_unlock_nopreempt(t); in cv_timedwait_sig_hires()
416 mutex_exit(&t->t_wait_mutex); in cv_timedwait_sig_hires()
418 if (ISSIG(t, JUSTLOOKING) || MUSTRETURN(p, t) || cancel_pending) in cv_timedwait_sig_hires()
419 setrun(t); in cv_timedwait_sig_hires()
422 signalled = (t->t_schedflag & TS_SIGNALLED); in cv_timedwait_sig_hires()
423 t->t_flag &= ~T_WAKEABLE; in cv_timedwait_sig_hires()
443 if (ISSIG_PENDING(t, lwp, p)) { in cv_timedwait_sig_hires()
449 if (lwp->lwp_sysabort || MUSTRETURN(p, t)) in cv_timedwait_sig_hires()
530 kthread_t *t = curthread; in cv_wait_sig_swap_core() local
531 proc_t *p = ttoproc(t); in cv_wait_sig_swap_core()
532 klwp_t *lwp = ttolwp(t); in cv_wait_sig_swap_core()
549 ASSERT(t->t_intr == NULL); in cv_wait_sig_swap_core()
554 thread_lock(t); in cv_wait_sig_swap_core()
555 t->t_kpri_req = 0; /* don't need kernel priority */ in cv_wait_sig_swap_core()
556 cv_block_sig(t, (condvar_impl_t *)cvp); in cv_wait_sig_swap_core()
559 thread_unlock_nopreempt(t); in cv_wait_sig_swap_core()
561 if (ISSIG(t, JUSTLOOKING) || MUSTRETURN(p, t) || cancel_pending) in cv_wait_sig_swap_core()
562 setrun(t); in cv_wait_sig_swap_core()
565 signalled = (t->t_schedflag & TS_SIGNALLED); in cv_wait_sig_swap_core()
566 t->t_flag &= ~T_WAKEABLE; in cv_wait_sig_swap_core()
570 if (ISSIG_PENDING(t, lwp, p)) { in cv_wait_sig_swap_core()
576 if (lwp->lwp_sysabort || MUSTRETURN(p, t)) in cv_wait_sig_swap_core()
615 kthread_t *t; in cv_signal() local
617 t = sleepq_wakeone_chan(&sqh->sq_queue, cp); in cv_signal()
623 ASSERT(t != NULL); in cv_signal()
657 kthread_t *t = curthread; in cv_wait_stop() local
658 klwp_t *lwp = ttolwp(t); in cv_wait_stop()
659 proc_t *p = ttoproc(t); in cv_wait_stop()
675 ASSERT(t->t_intr == NULL); in cv_wait_stop()
681 mutex_enter(&t->t_wait_mutex); in cv_wait_stop()
682 id = realtime_timeout_default((void (*)(void *))cv_wakeup, t, in cv_wait_stop()
684 thread_lock(t); /* lock the thread */ in cv_wait_stop()
686 thread_unlock_nopreempt(t); in cv_wait_stop()
687 mutex_exit(&t->t_wait_mutex); in cv_wait_stop()
702 if (t->t_proc_flag & TP_PAUSE) { in cv_wait_stop()
709 if (t->t_proc_flag & TP_CHKPT) { in cv_wait_stop()
718 (t->t_proc_flag & TP_HOLDLWP)) { in cv_wait_stop()
725 if (t->t_proc_flag & TP_PRSTOP) { in cv_wait_stop()
732 if (p->p_stopsig && t != p->p_agenttp) { in cv_wait_stop()