2005-04-27 Paul Jakma <paul.jakma@sun.com>
* workqueue.h: (struct work_queue_item) change retry_count to ran,
its a count of number item has been run.
* workqueue.c: (show_work_queues) Fix formating of slightly
bugfix: fix SIGFPE if wq->runs is 0.
(work_queue_run) retry logic was slightly wrong.
cycles.best is 0 initialy, granularity is 1, so update best
if cycles >= granularity, not just >.
diff --git a/lib/workqueue.h b/lib/workqueue.h
index 45fffe7..5b4e82e 100644
--- a/lib/workqueue.h
+++ b/lib/workqueue.h
@@ -42,7 +42,7 @@
struct work_queue_item
{
void *data; /* opaque data */
- unsigned short retry_count; /* number of times retried */
+ unsigned short ran; /* # of times item has been run */
};
struct work_queue
@@ -54,13 +54,13 @@
/* specification for this work queue */
struct {
/* work function to process items with */
- wq_item_status (*workfunc) (void *);
+ wq_item_status (*workfunc) ();
/* error handling function, optional */
void (*errorfunc) (struct work_queue *, struct work_queue_item *);
/* callback to delete user specific item data */
- void (*del_item_data) (void *);
+ void (*del_item_data) ();
/* max number of retries to make for item that errors */
unsigned int max_retries;