Make SCHED_ULE buildable with gcc3.

Reviewed by:	cognet (mentor), jeffr
Approved by:	cognet (mentor), jeffr
This commit is contained in:
Wojciech A. Koszek 2007-12-21 23:30:18 +00:00
parent d5d75e69bd
commit 731016fe36

View file

@ -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().
*/