mirror of
https://github.com/opnsense/src.git
synced 2026-04-23 23:28:37 -04:00
Make SCHED_ULE buildable with gcc3.
Reviewed by: cognet (mentor), jeffr Approved by: cognet (mentor), jeffr
This commit is contained in:
parent
d5d75e69bd
commit
731016fe36
1 changed files with 17 additions and 17 deletions
|
|
@ -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().
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue