| 112 | #endif |
| 113 | |
| 114 | static inline void |
| 115 | sched_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 |
no test coverage detected