summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_resource.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 04247e33094..6bc28d5aabc 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.82 2024/05/20 10:32:20 claudio Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.83 2024/05/22 09:20:22 claudio Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -213,11 +213,11 @@ donice(struct proc *curp, struct process *chgpr, int n)
return (EACCES);
chgpr->ps_nice = n;
mtx_enter(&chgpr->ps_mtx);
+ SCHED_LOCK(s);
TAILQ_FOREACH(p, &chgpr->ps_threads, p_thr_link) {
- SCHED_LOCK(s);
setpriority(p, p->p_estcpu, n);
- SCHED_UNLOCK(s);
}
+ SCHED_UNLOCK(s);
mtx_leave(&chgpr->ps_mtx);
return (0);
}