Deleted Added
full compact
65c65
< __FBSDID("$FreeBSD: head/sys/kern/subr_sleepqueue.c 141616 2005-02-10 12:02:37Z phk $");
---
> __FBSDID("$FreeBSD: head/sys/kern/subr_sleepqueue.c 145056 2005-04-14 06:30:32Z jhb $");
149,150c149
< static void sleepq_remove_thread(struct sleepqueue *sq, struct thread *td);
< static void sleepq_resume_thread(struct thread *td, int pri);
---
> static void sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri);
387,394c386,390
< if (TD_ON_SLEEPQ(td) && (sig != 0 || do_upcall != 0)) {
< mtx_unlock_spin(&sched_lock);
< sleepq_remove_thread(sq, td);
< } else {
< if (!TD_ON_SLEEPQ(td) && sig == 0)
< td->td_flags &= ~TDF_SINTR;
< mtx_unlock_spin(&sched_lock);
< }
---
> if (TD_ON_SLEEPQ(td) && (sig != 0 || do_upcall != 0))
> sleepq_resume_thread(sq, td, -1);
> else if (!TD_ON_SLEEPQ(td) && sig == 0)
> td->td_flags &= ~TDF_SINTR;
> mtx_unlock_spin(&sched_lock);
598c594,595
< * Removes a thread from a sleep queue.
---
> * Removes a thread from a sleep queue and makes it
> * runnable.
601c598
< sleepq_remove_thread(struct sleepqueue *sq, struct thread *td)
---
> sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri)
609a607
> mtx_assert(&sched_lock, MA_OWNED);
631d628
< mtx_lock_spin(&sched_lock);
634,635d630
< mtx_unlock_spin(&sched_lock);
< }
637,643d631
< /*
< * Resumes a thread that was asleep on a queue.
< */
< static void
< sleepq_resume_thread(struct thread *td, int pri)
< {
<
651d638
< mtx_lock_spin(&sched_lock);
661d647
< mtx_unlock_spin(&sched_lock);
695c681,683
< sleepq_remove_thread(sq, besttd);
---
> mtx_lock_spin(&sched_lock);
> sleepq_resume_thread(sq, besttd, pri);
> mtx_unlock_spin(&sched_lock);
697d684
< sleepq_resume_thread(besttd, pri);
706d692
< TAILQ_HEAD(, thread) list;
708d693
< struct thread *td;
720,726c705,709
< /* Move blocked threads from the sleep queue to a temporary list. */
< TAILQ_INIT(&list);
< while (!TAILQ_EMPTY(&sq->sq_blocked)) {
< td = TAILQ_FIRST(&sq->sq_blocked);
< sleepq_remove_thread(sq, td);
< TAILQ_INSERT_TAIL(&list, td, td_slpq);
< }
---
> /* Resume all blocked threads on the sleep queue. */
> mtx_lock_spin(&sched_lock);
> while (!TAILQ_EMPTY(&sq->sq_blocked))
> sleepq_resume_thread(sq, TAILQ_FIRST(&sq->sq_blocked), pri);
> mtx_unlock_spin(&sched_lock);
728,734d710
<
< /* Resume all the threads on the temporary list. */
< while (!TAILQ_EMPTY(&list)) {
< td = TAILQ_FIRST(&list);
< TAILQ_REMOVE(&list, td, td_slpq);
< sleepq_resume_thread(td, pri);
< }
781a758
> sleepq_resume_thread(sq, td, -1);
783d759
< sleepq_remove_thread(sq, td);
785d760
< sleepq_resume_thread(td, -1);
832d806
< mtx_unlock_spin(&sched_lock);
836c810
< sleepq_remove_thread(sq, td);
---
> sleepq_resume_thread(sq, td, -1);
838c812
< sleepq_resume_thread(td, -1);
---
> mtx_unlock_spin(&sched_lock);