From 731016fe36088e993eaddaeebf352313dcefb6ac Mon Sep 17 00:00:00 2001 From: "Wojciech A. Koszek" Date: Fri, 21 Dec 2007 23:30:18 +0000 Subject: [PATCH] Make SCHED_ULE buildable with gcc3. Reviewed by: cognet (mentor), jeffr Approved by: cognet (mentor), jeffr --- sys/kern/sched_ule.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 6841babf308..2bc0f3a27fb 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1757,6 +1757,23 @@ sched_switchin(struct tdq *tdq, struct thread *td) MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); } +/* + * Block a thread for switching. Similar to thread_block() but does not + * bump the spin count. + */ +static inline struct mtx * +thread_block_switch(struct thread *td) +{ + struct mtx *lock; + + THREAD_LOCK_ASSERT(td, MA_OWNED); + lock = td->td_lock; + td->td_lock = &blocked_lock; + mtx_unlock_spin(lock); + + return (lock); +} + /* * Handle migration from sched_switch(). This happens only for * cpu binding. @@ -1793,23 +1810,6 @@ sched_switch_migrate(struct tdq *tdq, struct thread *td, int flags) return (TDQ_LOCKPTR(tdn)); } -/* - * Block a thread for switching. Similar to thread_block() but does not - * bump the spin count. - */ -static inline struct mtx * -thread_block_switch(struct thread *td) -{ - struct mtx *lock; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - lock = td->td_lock; - td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); - - return (lock); -} - /* * Release a thread that was blocked with thread_block_switch(). */