diff options
author | paul <paul> | 2005-11-14 15:46:35 +0100 |
---|---|---|
committer | paul <paul> | 2005-11-14 15:46:35 +0100 |
commit | 889e9311e5c900ce24eecf00fcb5b8b9d51bb020 (patch) | |
tree | d5f3ebd53e4185157027becf01d67ace5400e24d /lib/workqueue.c | |
parent | 2005-11-14 Paul Jakma <paul.jakma@sun.com> (diff) | |
download | frr-889e9311e5c900ce24eecf00fcb5b8b9d51bb020.tar.xz frr-889e9311e5c900ce24eecf00fcb5b8b9d51bb020.zip |
[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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c index c2ff10db1..0c61f5c4f 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) |