diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2022-08-15 11:38:36 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2022-08-15 11:38:36 +0000 |
commit | add72d65f2933b4c4b0e78432ebe51d313c511b0 (patch) | |
tree | 33b30700c839576335c24830c058bd06dacc4a4d /sys | |
parent | 29bef7ae035faabf7c5cc4c7100f78aed4d1b58c (diff) |
Revert previous. It was not ok'ed by dlg@.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_task.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 <dlg@openbsd.org> @@ -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; |