* Update an ithread based on the associated intr_event. */
| 157 | * Update an ithread based on the associated intr_event. |
| 158 | */ |
| 159 | static void |
| 160 | ithread_update(struct intr_thread *ithd) |
| 161 | { |
| 162 | struct intr_event *ie; |
| 163 | struct thread *td; |
| 164 | u_char pri; |
| 165 | |
| 166 | ie = ithd->it_event; |
| 167 | td = ithd->it_thread; |
| 168 | mtx_assert(&ie->ie_lock, MA_OWNED); |
| 169 | |
| 170 | /* Determine the overall priority of this event. */ |
| 171 | if (CK_SLIST_EMPTY(&ie->ie_handlers)) |
| 172 | pri = PRI_MAX_ITHD; |
| 173 | else |
| 174 | pri = CK_SLIST_FIRST(&ie->ie_handlers)->ih_pri; |
| 175 | |
| 176 | /* Update name and priority. */ |
| 177 | strlcpy(td->td_name, ie->ie_fullname, sizeof(td->td_name)); |
| 178 | #ifdef KTR |
| 179 | sched_clear_tdname(td); |
| 180 | #endif |
| 181 | thread_lock(td); |
| 182 | sched_prio(td, pri); |
| 183 | thread_unlock(td); |
| 184 | } |
| 185 | |
| 186 | /* |
| 187 | * Regenerate the full name of an interrupt event and update its priority. |
no test coverage detected