Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by ozak...



details:   https://anonhg.NetBSD.org/src/rev/58045c8c7451
branches:  netbsd-8
changeset: 435062:58045c8c7451
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 14 19:59:18 2018 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #879):

        sys/kern/subr_workqueue.c: revision 1.37

Don't wait on workqueue_wait if called from worker itself

Otherwise workqueue_wait never return in such a case.  This treatment
is the same as callout_halt.

diffstat:

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

diffs (35 lines):

diff -r 01681f711d8a -r 58045c8c7451 sys/kern/subr_workqueue.c
--- a/sys/kern/subr_workqueue.c Thu Jun 14 19:57:23 2018 +0000
+++ b/sys/kern/subr_workqueue.c Thu Jun 14 19:59:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_workqueue.c,v 1.33.30.2 2018/02/05 14:55:16 martin Exp $  */
+/*     $NetBSD: subr_workqueue.c,v 1.33.30.3 2018/06/14 19:59:18 martin 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.33.30.2 2018/02/05 14:55:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.33.30.3 2018/06/14 19:59:18 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -286,6 +286,8 @@
        bool found = false;
 
        mutex_enter(&q->q_mutex);
+       if (q->q_worker == curlwp)
+               goto out;
     again:
        SIMPLEQ_FOREACH(wk, &q->q_queue_pending, wk_entry) {
                if (wk == wk_target)
@@ -305,6 +307,7 @@
        }
        if (q->q_waiter != NULL)
                q->q_waiter = NULL;
+    out:
        mutex_exit(&q->q_mutex);
 
        return found;



Home | Main Index | Thread Index | Old Index