Date: Sun, 25 Mar 2018 20:12:14 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331536 - head/sys/kern Message-ID: <201803252012.w2PKCEJY062124@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sun Mar 25 20:12:14 2018 New Revision: 331536 URL: https://svnweb.freebsd.org/changeset/base/331536 Log: Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching(). We may remove a sleepqueue from the hash table in sleepq_resume_thread(). Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14847 Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Mar 25 18:10:00 2018 (r331535) +++ head/sys/kern/subr_sleepqueue.c Sun Mar 25 20:12:14 2018 (r331536) @@ -1103,7 +1103,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; @@ -1112,7 +1112,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?201803252012.w2PKCEJY062124>