aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-05-21 17:15:56 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-05-21 17:15:56 +0000
commit1d7830edd51da56b1d9f033c4083a62dd71405ff (patch)
treec4ee8e41ff246b68f38493b812a98392ceaf6878 /sys/kern/sched_4bsd.c
parent07969f1d4d06aed0d97ad9c430d4f639ac5f81a0 (diff)
downloadsrc-1d7830edd51da56b1d9f033c4083a62dd71405ff.tar.gz
src-1d7830edd51da56b1d9f033c4083a62dd71405ff.zip
Assert that the thread passed to sched_bind() and sched_unbind() is
curthread as those routines are only supported for curthread currently. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=208391
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index cf215f5355dd..b4098c83e7ad 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1462,9 +1462,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;
@@ -1482,6 +1481,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;
}