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/linux No need to retry in cancel_del...
details: https://anonhg.NetBSD.org/src/rev/043290ba3a94
branches: trunk
changeset: 366354:043290ba3a94
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 15:02:19 2018 +0000
description:
No need to retry in cancel_delayed_work_sync after all.
diffstat:
sys/external/bsd/common/linux/linux_work.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diffs (59 lines):
diff -r 6e3b714ca0c8 -r 043290ba3a94 sys/external/bsd/common/linux/linux_work.c
--- a/sys/external/bsd/common/linux/linux_work.c Mon Aug 27 15:02:08 2018 +0000
+++ b/sys/external/bsd/common/linux/linux_work.c Mon Aug 27 15:02:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_work.c,v 1.23 2018/08/27 15:02:08 riastradh Exp $ */
+/* $NetBSD: linux_work.c,v 1.24 2018/08/27 15:02:19 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.23 2018/08/27 15:02:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.24 2018/08/27 15:02:19 riastradh Exp $");
#include <sys/types.h>
#include <sys/atomic.h>
@@ -656,15 +656,11 @@
cancel_delayed_work_sync(struct delayed_work *dw)
{
struct workqueue_struct *wq;
- bool cancelled_p = false;
+ bool cancelled_p;
-retry:
- /*
- * If there's no workqueue, nothing to cancel, unless we've
- * started over from cancelling the callout.
- */
+ /* If there's no workqueue, nothing to cancel. */
if ((wq = dw->work.work_queue) == NULL)
- return cancelled_p;
+ return false;
mutex_enter(&wq->wq_lock);
if (__predict_false(dw->work.work_queue != wq)) {
@@ -694,9 +690,9 @@
*
* If it's too late and the callout has already
* begun to execute, we must wait for it to
- * complete. In that case, the work has been
- * dissociated from the queue, so we must start
- * over from the top.
+ * complete. But we got in soon enough to ask
+ * the callout not to run, so we successfully
+ * cancelled it in that case.
*
* If we stopped the callout before it started,
* however, then destroy the callout and
@@ -705,7 +701,7 @@
dw->dw_state = DELAYED_WORK_CANCELLED;
cancelled_p = true;
if (callout_halt(&dw->dw_callout, &wq->wq_lock))
- goto retry;
+ break;
cancel_delayed_work_done(wq, dw);
break;
default:
Home |
Main Index |
Thread Index |
Old Index