From a75b147b3d4b9bd33d81354784b1827c809ec06e Mon Sep 17 00:00:00 2001 From: mvs Date: Mon, 15 Aug 2022 11:38:35 +0000 Subject: [PATCH] Revert previous. It was not ok'ed by dlg@. --- sys/kern/kern_task.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_task.c b/sys/kern/kern_task.c index 2a2fa256d42..71de6dc902b 100644 --- a/sys/kern/kern_task.c +++ b/sys/kern/kern_task.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_task.c,v 1.32 2022/08/15 09:10:36 mvs Exp $ */ +/* $OpenBSD: kern_task.c,v 1.33 2022/08/15 11:38:35 mvs Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -354,6 +354,9 @@ task_add(struct taskq *tq, struct task *w) { int rv = 0; + if (ISSET(w->t_flags, TASK_ONQUEUE)) + return (0); + mtx_enter(&tq->tq_mtx); if (!ISSET(w->t_flags, TASK_ONQUEUE)) { rv = 1; @@ -376,6 +379,9 @@ task_del(struct taskq *tq, struct task *w) { int rv = 0; + if (!ISSET(w->t_flags, TASK_ONQUEUE)) + return (0); + mtx_enter(&tq->tq_mtx); if (ISSET(w->t_flags, TASK_ONQUEUE)) { rv = 1; -- 2.20.1