MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sched_prio

Function sched_prio

freebsd/kern/sched_ule.c:1839–1864  ·  view source on GitHub ↗

* Standard entry for setting the priority to an absolute value. */

Source from the content-addressed store, hash-verified

1837 * Standard entry for setting the priority to an absolute value.
1838 */
1839void
1840sched_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.

Callers 15

epoch_adjust_prioFunction · 0.70
epoch_wait_preemptFunction · 0.70
acct_threadFunction · 0.70
tdsigwakeupFunction · 0.70
idle_setupFunction · 0.70
sleepq_resume_threadFunction · 0.70
astFunction · 0.70
cf_set_methodFunction · 0.70
sched_syncFunction · 0.70
_taskqueue_start_threadsFunction · 0.70
sched_lend_user_prioFunction · 0.70

Calls 2

sched_thread_priorityFunction · 0.85
turnstile_adjustFunction · 0.85

Tested by

no test coverage detected