Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern workqueue(9): workqueue_wait and workqueue_destroy ...



details:   https://anonhg.NetBSD.org/src/rev/8611c7643602
branches:  trunk
changeset: 368982:8611c7643602
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 15 11:43:56 2022 +0000

description:
workqueue(9): workqueue_wait and workqueue_destroy may sleep.

But might not, so assert sleepable up front.

diffstat:

 sys/kern/subr_workqueue.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 9108750fac50 -r 8611c7643602 sys/kern/subr_workqueue.c
--- a/sys/kern/subr_workqueue.c Mon Aug 15 11:29:53 2022 +0000
+++ b/sys/kern/subr_workqueue.c Mon Aug 15 11:43:56 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_workqueue.c,v 1.39 2020/09/08 17:02:18 riastradh Exp $    */
+/*     $NetBSD: subr_workqueue.c,v 1.40 2022/08/15 11:43:56 riastradh Exp $    */
 
 /*-
  * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.39 2020/09/08 17:02:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.40 2022/08/15 11:43:56 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -324,6 +324,8 @@
        struct workqueue_queue *q;
        bool found;
 
+       ASSERT_SLEEPABLE();
+
        if (ISSET(wq->wq_flags, WQ_PERCPU)) {
                struct cpu_info *ci;
                CPU_INFO_ITERATOR cii;
@@ -346,6 +348,8 @@
        struct cpu_info *ci;
        CPU_INFO_ITERATOR cii;
 
+       ASSERT_SLEEPABLE();
+
        wq->wq_func = workqueue_exit;
        for (CPU_INFO_FOREACH(cii, ci)) {
                q = workqueue_queue_lookup(wq, ci);



Home | Main Index | Thread Index | Old Index