Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/common Implement flush_delayed_work.



details:   https://anonhg.NetBSD.org/src/rev/909a8f9c2e95
branches:  trunk
changeset: 365879:909a8f9c2e95
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:05:39 2018 +0000

description:
Implement flush_delayed_work.

diffstat:

 sys/external/bsd/common/include/linux/workqueue.h |   4 +++-
 sys/external/bsd/common/linux/linux_work.c        |  13 +++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r ed88fb8d07a5 -r 909a8f9c2e95 sys/external/bsd/common/include/linux/workqueue.h
--- a/sys/external/bsd/common/include/linux/workqueue.h Mon Aug 27 07:05:13 2018 +0000
+++ b/sys/external/bsd/common/include/linux/workqueue.h Mon Aug 27 07:05:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: workqueue.h,v 1.5 2018/08/27 07:00:39 riastradh Exp $  */
+/*     $NetBSD: workqueue.h,v 1.6 2018/08/27 07:05:39 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -48,6 +48,7 @@
 #define        cancel_work_sync                linux_cancel_work_sync
 #define        current_work                    linux_current_work
 #define        destroy_workqueue               linux_destroy_workqueue
+#define        flush_delayed_work              linux_flush_delayed_work
 #define        flush_work                      linux_flush_work
 #define        flush_workqueue                 linux_flush_workqueue
 #define        queue_delayed_work              linux_queue_delayed_work
@@ -118,6 +119,7 @@
            unsigned long ticks);
 bool   cancel_delayed_work(struct delayed_work *);
 bool   cancel_delayed_work_sync(struct delayed_work *);
+void   flush_delayed_work(struct delayed_work *);
 
 struct work_struct *
        current_work(void);
diff -r ed88fb8d07a5 -r 909a8f9c2e95 sys/external/bsd/common/linux/linux_work.c
--- a/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 07:05:13 2018 +0000
+++ b/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 07:05:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_work.c,v 1.4 2018/08/27 07:00:39 riastradh Exp $ */
+/*     $NetBSD: linux_work.c,v 1.5 2018/08/27 07:05:39 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.4 2018/08/27 07:00:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.5 2018/08/27 07:05:39 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -889,6 +889,15 @@
        return cancelled_p;
 }
 
+void
+flush_delayed_work(struct delayed_work *dw)
+{
+       struct workqueue_struct *wq = dw->work.w_wq;
+
+       if (wq != NULL)
+               flush_workqueue(wq);
+}
+
 static void
 linux_cancel_delayed_work_callout(struct delayed_work *dw, bool wait)
 {



Home | Main Index | Thread Index | Old Index