1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-13 14:40:22 +00:00

- Set the base priority of an ithread that has no handlers when we set its

normal priority.
- Lock sched_lock while we dink with the priorities.
- Remove a few extra blank lines.
This commit is contained in:
John Baldwin 2002-04-11 21:03:35 +00:00
parent 5a882ddd66
commit b106d2f56a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94457

View File

@ -131,14 +131,18 @@ ithread_update(struct ithd *ithd)
strncpy(p->p_comm, ithd->it_name, sizeof(ithd->it_name));
ih = TAILQ_FIRST(&ithd->it_handlers);
if (ih == NULL) {
mtx_lock_spin(&sched_lock);
td->td_priority = PRI_MAX_ITHD;
td->td_base_pri = PRI_MAX_ITHD;
mtx_unlock_spin(&sched_lock);
ithd->it_flags &= ~IT_ENTROPY;
return;
}
entropy = 0;
mtx_lock_spin(&sched_lock);
td->td_priority = ih->ih_pri;
td->td_base_pri = ih->ih_pri;
mtx_unlock_spin(&sched_lock);
TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) {
if (strlen(p->p_comm) + strlen(ih->ih_name) + 1 <
sizeof(p->p_comm)) {
@ -154,12 +158,10 @@ ithread_update(struct ithd *ithd)
if (ih->ih_flags & IH_ENTROPY)
entropy++;
}
if (entropy)
ithd->it_flags |= IT_ENTROPY;
else
ithd->it_flags &= ~IT_ENTROPY;
CTR2(KTR_INTR, "%s: updated %s\n", __func__, p->p_comm);
}