summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2018-03-28 14:00:46 +0000
committermarkj <markj@FreeBSD.org>2018-03-28 14:00:46 +0000
commita49b767ec00701e78a120c8d4dcf2c4f07ca9946 (patch)
treec55e0c506b930a76769c872691badffb35d0e5fd /sys/kern
parent70103ce46f7a4f1731900e377c671246f9cbd0a8 (diff)
downloadFreeBSD-src-a49b767ec00701e78a120c8d4dcf2c4f07ca9946.zip
FreeBSD-src-a49b767ec00701e78a120c8d4dcf2c4f07ca9946.tar.gz
MFC r331536:
Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching().
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_sleepqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index 0b93767..c98530c 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -1098,7 +1098,7 @@ void
sleepq_chains_remove_matching(bool (*matches)(struct thread *))
{
struct sleepqueue_chain *sc;
- struct sleepqueue *sq;
+ struct sleepqueue *sq, *sq1;
int i, wakeup_swapper;
wakeup_swapper = 0;
@@ -1107,7 +1107,7 @@ sleepq_chains_remove_matching(bool (*matches)(struct thread *))
continue;
}
mtx_lock_spin(&sc->sc_lock);
- LIST_FOREACH(sq, &sc->sc_queues, sq_hash) {
+ LIST_FOREACH_SAFE(sq, &sc->sc_queues, sq_hash, sq1) {
for (i = 0; i < NR_SLEEPQS; ++i) {
wakeup_swapper |= sleepq_remove_matching(sq, i,
matches, 0);
OpenPOWER on IntegriCloud