Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2018 14:00:46 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331672 - stable/11/sys/kern
Message-ID:  <201803281400.w2SE0kjI081407@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803281400.w2SE0kjI081407>