* Standard entry for setting the priority to an absolute value. */
| 1837 | * Standard entry for setting the priority to an absolute value. |
| 1838 | */ |
| 1839 | void |
| 1840 | sched_prio(struct thread *td, u_char prio) |
| 1841 | { |
| 1842 | u_char oldprio; |
| 1843 | |
| 1844 | /* First, update the base priority. */ |
| 1845 | td->td_base_pri = prio; |
| 1846 | |
| 1847 | /* |
| 1848 | * If the thread is borrowing another thread's priority, don't |
| 1849 | * ever lower the priority. |
| 1850 | */ |
| 1851 | if (td->td_flags & TDF_BORROWING && td->td_priority < prio) |
| 1852 | return; |
| 1853 | |
| 1854 | /* Change the real priority. */ |
| 1855 | oldprio = td->td_priority; |
| 1856 | sched_thread_priority(td, prio); |
| 1857 | |
| 1858 | /* |
| 1859 | * If the thread is on a turnstile, then let the turnstile update |
| 1860 | * its state. |
| 1861 | */ |
| 1862 | if (TD_ON_LOCK(td) && oldprio != prio) |
| 1863 | turnstile_adjust(td, oldprio); |
| 1864 | } |
| 1865 | |
| 1866 | /* |
| 1867 | * Set the base user priority, does not effect current running priority. |
no test coverage detected