Author: jhb Date: Thu Jun 24 12:09:12 2010 New Revision: 209504 URL: http://svn.freebsd.org/changeset/base/209504
Log: MFC 208391: Assert that the thread passed to sched_bind() and sched_unbind() is curthread as those routines are only supported for curthread currently. Modified: stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Thu Jun 24 12:08:50 2010 (r209503) +++ stable/7/sys/kern/sched_4bsd.c Thu Jun 24 12:09:12 2010 (r209504) @@ -1345,9 +1345,8 @@ sched_bind(struct thread *td, int cpu) { struct td_sched *ts; - THREAD_LOCK_ASSERT(td, MA_OWNED); - KASSERT(TD_IS_RUNNING(td), - ("sched_bind: cannot bind non-running thread")); + THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; @@ -1365,6 +1364,7 @@ void sched_unbind(struct thread* td) { THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); td->td_flags &= ~TDF_BOUND; } Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jun 24 12:08:50 2010 (r209503) +++ stable/7/sys/kern/sched_ule.c Thu Jun 24 12:09:12 2010 (r209504) @@ -2574,6 +2574,7 @@ sched_bind(struct thread *td, int cpu) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; if (ts->ts_flags & TSF_BOUND) sched_unbind(td); @@ -2597,6 +2598,7 @@ sched_unbind(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); ts = td->td_sched; if ((ts->ts_flags & TSF_BOUND) == 0) return; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"