Lines Matching refs:td2
931 struct thread *td2; in thread_exit() local
968 td2 = FIRST_THREAD_IN_PROC(p); in thread_exit()
969 sched_exit_thread(td2, td); in thread_exit()
1136 weed_inhib(int mode, struct thread *td2, struct proc *p) in weed_inhib() argument
1142 THREAD_LOCK_ASSERT(td2, MA_OWNED); in weed_inhib()
1153 if (TD_IS_SUSPENDED(td2)) { in weed_inhib()
1154 wakeup_swapper |= thread_unsuspend_one(td2, p, true); in weed_inhib()
1155 thread_lock(td2); in weed_inhib()
1158 if (TD_CAN_ABORT(td2)) { in weed_inhib()
1159 wakeup_swapper |= sleepq_abort(td2, EINTR); in weed_inhib()
1165 if (TD_IS_SUSPENDED(td2) && in weed_inhib()
1166 (td2->td_flags & TDF_BOUNDARY) == 0) { in weed_inhib()
1167 wakeup_swapper |= thread_unsuspend_one(td2, p, false); in weed_inhib()
1168 thread_lock(td2); in weed_inhib()
1171 if (TD_CAN_ABORT(td2)) { in weed_inhib()
1172 wakeup_swapper |= sleepq_abort(td2, ERESTART); in weed_inhib()
1185 if (TD_IS_SUSPENDED(td2) && in weed_inhib()
1186 (td2->td_flags & TDF_ALLPROCSUSP) == 0) { in weed_inhib()
1187 wakeup_swapper |= thread_unsuspend_one(td2, p, false); in weed_inhib()
1188 thread_lock(td2); in weed_inhib()
1191 if (TD_CAN_ABORT(td2)) { in weed_inhib()
1192 td2->td_flags |= TDF_ALLPROCSUSP; in weed_inhib()
1193 wakeup_swapper |= sleepq_abort(td2, ERESTART); in weed_inhib()
1200 thread_unlock(td2); in weed_inhib()
1221 struct thread *td2; in thread_single() local
1278 FOREACH_THREAD_IN_PROC(p, td2) { in thread_single()
1279 if (td2 == td) in thread_single()
1281 thread_lock(td2); in thread_single()
1282 ast_sched_locked(td2, TDA_SUSPEND); in thread_single()
1283 if (TD_IS_INHIBITED(td2)) { in thread_single()
1284 wakeup_swapper |= weed_inhib(mode, td2, p); in thread_single()
1286 } else if (TD_IS_RUNNING(td2)) { in thread_single()
1287 forward_signal(td2); in thread_single()
1288 thread_unlock(td2); in thread_single()
1291 thread_unlock(td2); in thread_single()
1344 FOREACH_THREAD_IN_PROC(p, td2) { in thread_single()
1345 if (td2 == td) in thread_single()
1347 thread_lock(td2); in thread_single()
1348 KASSERT((td2->td_flags & TDF_BOUNDARY) != 0, in thread_single()
1349 ("td %p not on boundary", td2)); in thread_single()
1350 KASSERT(TD_IS_SUSPENDED(td2), in thread_single()
1351 ("td %p is not suspended", td2)); in thread_single()
1352 thread_unlock(td2); in thread_single()