Deleted Added
full compact
38c38
< __FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 133396 2004-08-09 18:21:12Z julian $");
---
> __FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 134013 2004-08-19 11:31:42Z jhb $");
128c128
< int catch, rval, sig;
---
> int catch, rval, sig, flags;
169,171c169
< mtx_lock_spin(&sched_lock);
<
< if (p->p_flag & P_SA || p->p_numthreads > 1) {
---
> if (catch) {
173,175c171,172
< * Just don't bother if we are exiting
< * and not the exiting thread or thread was marked as
< * interrupted.
---
> * Don't bother sleeping if we are exiting and not the exiting
> * thread or if our thread is marked as interrupted.
177,187c174,179
< if (catch) {
< if ((p->p_flag & P_SINGLE_EXIT) && p->p_singlethread != td) {
< mtx_unlock_spin(&sched_lock);
< sleepq_release(ident);
< return (EINTR);
< }
< if (td->td_flags & TDF_INTERRUPT) {
< mtx_unlock_spin(&sched_lock);
< sleepq_release(ident);
< return (td->td_intrval);
< }
---
> mtx_lock_spin(&sched_lock);
> rval = thread_sleep_check(td);
> mtx_unlock_spin(&sched_lock);
> if (rval != 0) {
> sleepq_release(ident);
> return (rval);
190d181
< mtx_unlock_spin(&sched_lock);
210c201,204
< sleepq_add(sq, ident, mtx, wmesg, 0);
---
> flags = SLEEPQ_MSLEEP;
> if (catch)
> flags |= SLEEPQ_INTERRUPTIBLE;
> sleepq_add(sq, ident, mtx, wmesg, flags);
215,220d208
< if (sig == 0 && !TD_ON_SLEEPQ(td)) {
< mtx_lock_spin(&sched_lock);
< td->td_flags &= ~TDF_SINTR;
< mtx_unlock_spin(&sched_lock);
< catch = 0;
< }
265c253
< sleepq_broadcast(ident, 0, -1);
---
> sleepq_broadcast(ident, SLEEPQ_MSLEEP, -1);
278c266
< sleepq_signal(ident, 0, -1);
---
> sleepq_signal(ident, SLEEPQ_MSLEEP, -1);