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

Function sched_userret

freebsd/sys/sched.h:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112#endif
113
114static inline void
115sched_userret(struct thread *td)
116{
117
118 /*
119 * XXX we cheat slightly on the locking here to avoid locking in
120 * the usual case. Setting td_priority here is essentially an
121 * incomplete workaround for not setting it properly elsewhere.
122 * Now that some interrupt handlers are threads, not setting it
123 * properly elsewhere can clobber it in the window between setting
124 * it here and returning to user mode, so don't waste time setting
125 * it perfectly here.
126 */
127 KASSERT((td->td_flags & TDF_BORROWING) == 0,
128 ("thread with borrowed priority returning to userland"));
129 if (__predict_false(td->td_priority != td->td_user_pri))
130 sched_userret_slowpath(td);
131}
132
133/*
134 * Threads are moved on and off of run queues

Callers 1

userretFunction · 0.85

Calls 1

sched_userret_slowpathFunction · 0.50

Tested by

no test coverage detected