diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-05-09 03:27:45 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-05-09 03:27:45 +0400 |
commit | c4b79e4b5448abcd04c1848e212a237e8b17c3de (patch) | |
tree | cb6842905af200754a9c08521abe33e56017f2be /examples | |
parent | 92fdad5448cda86a2e0fc4a0d3ff8843d6435e11 (diff) |
runqueue: move completion handler from runqueue_process to runqueue_task to make it more generic
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/runqueue-example.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/runqueue-example.c b/examples/runqueue-example.c index 727463f..1ae184a 100644 --- a/examples/runqueue-example.c +++ b/examples/runqueue-example.c @@ -66,9 +66,9 @@ static void q_sleep_cancel(struct runqueue *q, struct runqueue_task *t, int type runqueue_process_cancel_cb(q, t, type); } -static void q_sleep_complete(struct runqueue *q, struct runqueue_process *p, int ret) +static void q_sleep_complete(struct runqueue *q, struct runqueue_task *p) { - struct sleeper *s = container_of(p, struct sleeper, proc); + struct sleeper *s = container_of(p, struct sleeper, proc.task); fprintf(stderr, "[%d/%d] finish 'sleep %d'\n", q->running_tasks, q->max_running_tasks, s->val); free(s); @@ -86,7 +86,7 @@ static void add_sleeper(int val) s = calloc(1, sizeof(*s)); s->proc.task.type = &sleeper_type; s->proc.task.run_timeout = 500; - s->proc.complete = q_sleep_complete; + s->proc.task.complete = q_sleep_complete; s->val = val; runqueue_task_add(&q, &s->proc.task, false); } |