From 889e9311e5c900ce24eecf00fcb5b8b9d51bb020 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 14 Nov 2005 14:46:35 +0000 Subject: [workqueue] Update workqueue users callbacks to additional arguments 2005-11-14 Paul Jakma * (general) pass struct work-queue to callback functions. * workqueue.h: (struct work_queue) move the state flag variables to end. Add an opaque pointer to spec, for user-data global to the queue. Pass reference to work_queue to all callbacks. * workqueue.c: (work_queue_item_remove) pass ref to workqueue to user callbacks. (work_queue_run) ditto. --- lib/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/workqueue.c') diff --git a/lib/workqueue.c b/lib/workqueue.c index c2ff10db..0c61f5c4 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -147,7 +147,7 @@ work_queue_item_remove (struct work_queue *wq, struct listnode *ln) /* call private data deletion callback if needed */ if (wq->spec.del_item_data) - wq->spec.del_item_data (item->data); + wq->spec.del_item_data (wq, item->data); list_delete_node (wq->items, ln); work_queue_item_free (item); @@ -284,7 +284,7 @@ work_queue_run (struct thread *thread) /* run and take care of items that want to be retried immediately */ do { - ret = wq->spec.workfunc (item->data); + ret = wq->spec.workfunc (wq, item->data); item->ran++; } while ((ret == WQ_RETRY_NOW) -- cgit v1.2.1