svn commit: r331672 - stable/11/sys/kern

Mark Johnston markj at FreeBSD.org
Wed Mar 28 14:00:50 UTC 2018


Author: markj
Date: Wed Mar 28 14:00:46 2018
New Revision: 331672
URL: https://svnweb.freebsd.org/changeset/base/331672

Log:
  MFC r331536:
  Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching().

Modified:
  stable/11/sys/kern/subr_sleepqueue.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/subr_sleepqueue.c
==============================================================================
--- stable/11/sys/kern/subr_sleepqueue.c	Wed Mar 28 13:44:02 2018	(r331671)
+++ stable/11/sys/kern/subr_sleepqueue.c	Wed Mar 28 14:00:46 2018	(r331672)
@@ -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 t
 			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);


More information about the svn-src-all mailing list