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

Function ithread_update

freebsd/kern/kern_intr.c:159–184  ·  view source on GitHub ↗

* Update an ithread based on the associated intr_event. */

Source from the content-addressed store, hash-verified

157 * Update an ithread based on the associated intr_event.
158 */
159static void
160ithread_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.

Callers 2

intr_event_updateFunction · 0.85
intr_event_add_handlerFunction · 0.85

Calls 4

mtx_assertFunction · 0.85
sched_clear_tdnameFunction · 0.70
sched_prioFunction · 0.70
strlcpyFunction · 0.50

Tested by

no test coverage detected