From 11e8afea0f7eb34f8c23a8e589ee659c46f3f8aa Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 2 Jul 2013 18:31:25 +0200 Subject: [PATCH] runqueue should cal the complete handler from more places Signed-off-by: John Crispin --- runqueue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runqueue.c b/runqueue.c index 1bdb48e..189a005 100644 --- a/runqueue.c +++ b/runqueue.c @@ -186,8 +186,6 @@ void runqueue_task_kill(struct runqueue_task *t) runqueue_task_complete(t); if (running && t->type->kill) t->type->kill(q, t); - if (t->complete) - t->complete(q, t); runqueue_start_next(q); } @@ -205,6 +203,8 @@ void runqueue_resume(struct runqueue *q) void runqueue_task_complete(struct runqueue_task *t) { + struct runqueue *q = t->q; + if (!t->queued) return; @@ -215,6 +215,8 @@ void runqueue_task_complete(struct runqueue_task *t) t->queued = false; t->running = false; t->cancelled = false; + if (t->complete) + t->complete(q, t); runqueue_start_next(t->q); } -- 2.25.1