* Adjust thread priorities as a result of a nice request. */
| 2166 | * Adjust thread priorities as a result of a nice request. |
| 2167 | */ |
| 2168 | void |
| 2169 | sched_nice(struct proc *p, int nice) |
| 2170 | { |
| 2171 | struct thread *td; |
| 2172 | |
| 2173 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 2174 | |
| 2175 | p->p_nice = nice; |
| 2176 | FOREACH_THREAD_IN_PROC(p, td) { |
| 2177 | thread_lock(td); |
| 2178 | sched_priority(td); |
| 2179 | sched_prio(td, td->td_base_user_pri); |
| 2180 | thread_unlock(td); |
| 2181 | } |
| 2182 | } |
| 2183 | |
| 2184 | /* |
| 2185 | * Record the sleep time for the interactivity scorer. |
no test coverage detected