summaryrefslogtreecommitdiff
path: root/lib/workqueue.c
diff options
context:
space:
mode:
authorpaul <paul>2005-11-14 14:46:35 +0000
committerpaul <paul>2005-11-14 14:46:35 +0000
commit889e9311e5c900ce24eecf00fcb5b8b9d51bb020 (patch)
treed5f3ebd53e4185157027becf01d67ace5400e24d /lib/workqueue.c
parent0fb58d5d7993b638fc46085944d17d3a54d66046 (diff)
[workqueue] Update workqueue users callbacks to additional arguments
2005-11-14 Paul Jakma <paul.jakma@sun.com> * (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.
Diffstat (limited to 'lib/workqueue.c')
-rw-r--r--lib/workqueue.c4
1 files changed, 2 insertions, 2 deletions
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)